summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2011-12-18 14:49:38 +0100
committerJan Djärv <jan.h.d@swipnet.se>2011-12-18 14:49:38 +0100
commitc803b2b767f8ed06beb28106a03f23bc577cfdae (patch)
tree605daf67747b4ec447f5e133d9dce821e0efc53f /lisp
parente1b01a3a530809a1e84ecddff31faf85b94e79e7 (diff)
downloademacs-c803b2b767f8ed06beb28106a03f23bc577cfdae.tar.gz
NS selection bug fix and cleanup, see thread C-g crash in C-x C-f (OSX Lion).
Thread is on emacs-devel. * lisp/term/ns-win.el (ns-get-selection-internal) (ns-store-selection-internal): Declare. (ns-store-cut-buffer-internal, ns-get-cut-buffer-internal): Declare as obsolete. (ns-get-pasteboard, ns-paste-secondary): Use ns-get-selection-internal. (ns-set-pasteboard, ns-copy-including-secondary): Use ns-store-selection-internal. * src/nsselect.m (CUT_BUFFER_SUPPORT): Remove define. (symbol_to_nsstring): Fix indentation. (ns_symbol_to_pb): New function. (Fns_get_selection_internal): Renamed from Fns_get_cut_buffer_internal. (Fns_rotate_cut_buffers_internal): Removed. (Fns_store_selection_internal): Renamed from Fns_store_cut_buffer_internal. (ns_get_foreign_selection, Fx_own_selection_internal) (Fx_disown_selection_internal, Fx_selection_exists_p) (Fns_get_selection_internal, Fns_store_selection_internal): Use ns_symbol_to_pb and check if return value is nil. (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal renamed to Sns_store_selection_internal. (ns_handle_selection_request): Move code to Fx_own_selection_internal and remove this function. (ns_handle_selection_clear): Remove, never used. (Fx_own_selection_internal): Move code from ns_handle_selection_request here.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/term/ns-win.el21
2 files changed, 24 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 990a7259bc8..9be0d2f1a3c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * term/ns-win.el (ns-get-selection-internal)
+ (ns-store-selection-internal): Declare.
+ (ns-store-cut-buffer-internal, ns-get-cut-buffer-internal): Declare
+ as obsolete.
+ (ns-get-pasteboard, ns-paste-secondary): Use
+ ns-get-selection-internal.
+ (ns-set-pasteboard, ns-copy-including-secondary): Use
+ ns-store-selection-internal.
+
2011-12-17 Chong Yidong <cyd@gnu.org>
* vc/vc.el (vc-next-action): Doc fix; remove CVS-isms.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index b639af7cda0..df0ddd7de8b 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -702,19 +702,24 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;;;; Pasteboard support.
-(declare-function ns-get-cut-buffer-internal "nsselect.m" (buffer))
+(declare-function ns-get-selection-internal "nsselect.m" (buffer))
+(declare-function ns-store-selection-internal "nsselect.m" (buffer string))
+
+(define-obsolete-function-alias 'ns-get-cut-buffer-internal
+ 'ns-get-selection-internal "24.1")
+(define-obsolete-function-alias 'ns-store-cut-buffer-internal
+ 'ns-store-selection-internal "24.1")
+
(defun ns-get-pasteboard ()
"Returns the value of the pasteboard."
- (ns-get-cut-buffer-internal 'CLIPBOARD))
-
-(declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string))
+ (ns-get-selection-internal 'CLIPBOARD))
(defun ns-set-pasteboard (string)
"Store STRING into the pasteboard of the Nextstep display server."
;; Check the data type of STRING.
(if (not (stringp string)) (error "Nonstring given to pasteboard"))
- (ns-store-cut-buffer-internal 'CLIPBOARD string))
+ (ns-store-selection-internal 'CLIPBOARD string))
;; We keep track of the last text selected here, so we can check the
;; current selection against it, and avoid passing back our own text
@@ -742,11 +747,11 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(defun ns-copy-including-secondary ()
(interactive)
(call-interactively 'kill-ring-save)
- (ns-store-cut-buffer-internal 'SECONDARY
- (buffer-substring (point) (mark t))))
+ (ns-store-selection-internal 'SECONDARY
+ (buffer-substring (point) (mark t))))
(defun ns-paste-secondary ()
(interactive)
- (insert (ns-get-cut-buffer-internal 'SECONDARY)))
+ (insert (ns-get-selection-internal 'SECONDARY)))
;;;; Scrollbar handling.