From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Odd unused yank-handler arguments Date: Sun, 02 May 2010 02:15:32 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272780956 4615 80.91.229.12 (2 May 2010 06:15:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 May 2010 06:15:56 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 02 08:15:55 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8ST5-0006Hn-Dl for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 08:15:55 +0200 Original-Received: from localhost ([127.0.0.1]:46554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8ST4-0006JV-OU for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 02:15:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8SSz-0006JQ-Jb for emacs-devel@gnu.org; Sun, 02 May 2010 02:15:49 -0400 Original-Received: from [140.186.70.92] (port=43656 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8SSy-0006JI-B1 for emacs-devel@gnu.org; Sun, 02 May 2010 02:15:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8SSw-0006NR-Tt for emacs-devel@gnu.org; Sun, 02 May 2010 02:15:48 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:40149 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8SSw-0006NL-OW for emacs-devel@gnu.org; Sun, 02 May 2010 02:15:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ak0FAPe13EvO+KoL/2dsb2JhbACRC4whcrhjhRIEjCg X-IronPort-AV: E=Sophos;i="4.52,311,1270440000"; d="scan'208";a="63068634" Original-Received: from 206-248-170-11.dsl.teksavvy.com (HELO pastel.home) ([206.248.170.11]) by ironport2-out.pppoe.ca with ESMTP; 02 May 2010 02:15:32 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0C0BE82C3; Sun, 2 May 2010 02:15:32 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124413 Archived-At: 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)