unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Odd unused yank-handler arguments
Date: Sun, 02 May 2010 02:15:32 -0400	[thread overview]
Message-ID: <jwvtyqqu8xh.fsf-monnier+emacs@gnu.org> (raw)

Any objection to the patch below?


        Stefan


=== 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))
 	nil)





             reply	other threads:[~2010-05-02  6:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-02  6:15 Stefan Monnier [this message]
2010-05-02 13:54 ` Odd unused yank-handler arguments Drew Adams
2010-05-02 19:50   ` Stefan Monnier
2010-05-02 19:55     ` Drew Adams
2010-05-02 19:48 ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvtyqqu8xh.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).