[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd unused yank-handler arguments

From: Stefan Monnier
Subject: Odd unused yank-handler arguments
Date: Sun, 02 May 2010 02:15:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Any objection to the patch below?


=== modified file 'lisp/simple.el'
--- lisp/simple.el      2010-05-02 06:12:39 +0000
+++ lisp/simple.el      2010-05-02 06:14:00 +0000
@@ -2929,7 +2929,7 @@
   :group 'killing
   :version "23.2")
-(defun kill-new (string &optional replace yank-handler)
+(defun kill-new (string &optional replace)
   "Make STRING the latest kill in the kill ring.
 Set `kill-ring-yank-pointer' to point to it.
 If `interprogram-cut-function' is non-nil, apply it to STRING.
@@ -2964,13 +2964,6 @@
         (kill-new paste))))
   ;; The actual kill-new functionality.
   (when (equal string (car kill-ring)) (setq replace t))
-  (if (> (length string) 0)
-      (if yank-handler
-         (put-text-property 0 (length string)
-                            'yank-handler yank-handler string))
-    (if yank-handler
-       (signal 'args-out-of-range
-               (list string "yank-handler specified for empty string"))))
   (when (and kill-do-not-save-duplicates
              (equal string (car kill-ring)))
     (setq replace t))
@@ -2993,7 +2986,7 @@
   (if interprogram-cut-function
       (funcall interprogram-cut-function string (not replace))))
-(defun kill-append (string before-p &optional yank-handler)
+(defun kill-append (string before-p)
   "Append STRING to the end of the latest kill in the kill ring.
 If BEFORE-P is non-nil, prepend STRING to the kill.
 Optional third argument YANK-HANDLER, if non-nil, specifies the
@@ -3004,10 +2997,7 @@
 instead of replacing the last kill with it.
 If `interprogram-cut-function' is set, pass the resulting kill to it."
   (let* ((cur (car kill-ring)))
-    (kill-new (if before-p (concat string cur) (concat cur string))
-             (or (= (length cur) 0)
-                 (equal yank-handler (get-text-property 0 'yank-handler cur)))
-             yank-handler)))
+    (kill-new (if before-p (concat string cur) (concat cur string)) t)))
 (defcustom yank-pop-change-selection nil
   "If non-nil, rotating the kill ring changes the window system selection."
@@ -3068,7 +3058,7 @@
      '(text-read-only buffer-read-only error))
 (put 'text-read-only 'error-message (purecopy "Text is read-only"))
-(defun kill-region (beg end &optional yank-handler)
+(defun kill-region (beg end)
   "Kill (\"cut\") text between point and mark.
 This deletes the text from the buffer and saves it in the kill ring.
 The command \\[yank] can retrieve it from there.
@@ -3102,8 +3092,8 @@
        (when string                    ;STRING is nil if BEG = END
          ;; Add that string to the kill ring, one way or another.
          (if (eq last-command 'kill-region)
-             (kill-append string (< end beg) yank-handler)
-           (kill-new string nil yank-handler)))
+             (kill-append string (< end beg))
+           (kill-new string)))
        (when (or string (eq last-command 'kill-region))
          (setq this-command 'kill-region))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]