[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107590: * lisp/simple.el (kill-new):
From: |
Leo Liu |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107590: * lisp/simple.el (kill-new): Use equal-including-properties for |
Date: |
Tue, 13 Mar 2012 02:21:35 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107590
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Tue 2012-03-13 02:21:35 +0800
message:
* lisp/simple.el (kill-new): Use equal-including-properties for
comparison.
(kill-do-not-save-duplicates): Doc fix.
modified:
lisp/ChangeLog
lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-03-12 13:03:10 +0000
+++ b/lisp/ChangeLog 2012-03-12 18:21:35 +0000
@@ -1,3 +1,9 @@
+2012-03-12 Leo Liu <address@hidden>
+
+ * simple.el (kill-new): Use equal-including-properties for
+ comparison.
+ (kill-do-not-save-duplicates): Doc fix.
+
2012-03-12 Stefan Monnier <address@hidden>
* dabbrev.el: Fix cycle completion (bug#10963).
=== modified file 'lisp/simple.el'
--- a/lisp/simple.el 2012-03-11 16:57:04 +0000
+++ b/lisp/simple.el 2012-03-12 18:21:35 +0000
@@ -3069,7 +3069,8 @@
:version "23.2")
(defcustom kill-do-not-save-duplicates nil
- "Do not add a new string to `kill-ring' when it is the same as the last one."
+ "Do not add a new string to `kill-ring' if it duplicates the last one.
+The comparison is done using `equal-including-properties'."
:type 'boolean
:group 'killing
:version "23.2")
@@ -3097,7 +3098,10 @@
(signal 'args-out-of-range
(list string "yank-handler specified for empty string"))))
(unless (and kill-do-not-save-duplicates
- (equal string (car kill-ring)))
+ ;; Due to text properties such as 'yank-handler that
+ ;; can alter the contents to yank, comparison using
+ ;; `equal' is unsafe.
+ (equal-including-properties string (car kill-ring)))
(if (fboundp 'menu-bar-update-yank-menu)
(menu-bar-update-yank-menu string (and replace (car kill-ring)))))
(when save-interprogram-paste-before-kill
@@ -3108,10 +3112,10 @@
(nreverse interprogram-paste)
(list interprogram-paste)))
(unless (and kill-do-not-save-duplicates
- (equal s (car kill-ring)))
+ (equal-including-properties s (car kill-ring)))
(push s kill-ring))))))
(unless (and kill-do-not-save-duplicates
- (equal string (car kill-ring)))
+ (equal-including-properties string (car kill-ring)))
(if (and replace kill-ring)
(setcar kill-ring string)
(push string kill-ring)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107590: * lisp/simple.el (kill-new): Use equal-including-properties for,
Leo Liu <=