;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(defvar mac-apple-event-map)
(defvar mac-font-panel-mode)
(defvar mac-ts-active-input-overlay)
+(defvar mac-ts-active-input-buf)
(defvar x-invocation-args)
(declare-function mac-code-convert-string "mac.c")
(declare-function mac-coerce-ae-data "mac.c")
(let ((line (car selection-range))
(start (cadr selection-range))
(end (nth 2 selection-range)))
- (if (> line 0)
- (goto-line line)
- (if (and (> start 0) (> end 0))
- (progn (set-mark start)
- (goto-char end))))))
+ (if (>= line 0)
+ (goto-line (1+ line))
+ (if (and (>= start 0) (>= end 0))
+ (progn (set-mark (1+ start))
+ (goto-char (1+ end)))))))
((stringp search-text)
(re-search-forward
(mapconcat 'regexp-quote (split-string search-text) "\\|")
) ;; (fboundp 'mac-set-font-panel-visible-p)
;;; Text Services
-(defvar mac-ts-active-input-buf ""
- "Byte sequence of the current Mac TSM active input area.")
(defvar mac-ts-update-active-input-area-seqno 0
"Number of processed update-active-input-area events.")
(setq mac-ts-active-input-overlay (make-overlay 0 0))
(defun mac-service-open-file ()
"Open the file specified by the selection value for Services."
(interactive)
- (find-file-existing (x-selection-value mac-service-selection)))
+ ;; The selection seems not to contain the file name as
+ ;; public.utf16-plain-text data on Mac OS X 10.4.
+ (dnd-open-file (x-get-selection mac-service-selection 'public.file-url) nil))
(defun mac-service-open-selection ()
"Create a new buffer containing the selection value for Services."