Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / lisp / term / mac-win.el
index c8f26ed..95a873f 100644 (file)
@@ -8,10 +8,10 @@
 
 ;; 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
@@ -19,9 +19,7 @@
 ;; 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:
 
@@ -83,6 +81,7 @@
 (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")
@@ -1802,11 +1801,11 @@ if possible.  If there's no such frame, a new frame is created."
             (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) "\\|")
@@ -1926,8 +1925,6 @@ With numeric ARG, display the font panel if and only if ARG is positive."
 ) ;; (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))
@@ -2197,7 +2194,9 @@ either in the current buffer or in the echo area."
 (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."