diff options
| author | Leo Liu | 2012-03-13 02:21:35 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-03-13 02:21:35 +0800 |
| commit | e2f1fdab9105065bda0212bf1558eca186c2f3cb (patch) | |
| tree | c61eae35d42a4ac23af8a9ba5406d39da91dbbb4 | |
| parent | b19490edc32e6c423f8b18174aba41a513bbe1eb (diff) | |
| download | emacs-e2f1fdab9105065bda0212bf1558eca186c2f3cb.tar.gz emacs-e2f1fdab9105065bda0212bf1558eca186c2f3cb.zip | |
* lisp/simple.el (kill-new): Use equal-including-properties for
comparison.
(kill-do-not-save-duplicates): Doc fix.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/simple.el | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb03ba0b436..4f883b1cf94 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-03-12 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * simple.el (kill-new): Use equal-including-properties for | ||
| 4 | comparison. | ||
| 5 | (kill-do-not-save-duplicates): Doc fix. | ||
| 6 | |||
| 1 | 2012-03-12 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2012-03-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * dabbrev.el: Fix cycle completion (bug#10963). | 9 | * dabbrev.el: Fix cycle completion (bug#10963). |
diff --git a/lisp/simple.el b/lisp/simple.el index f42ea3e7a50..936037f5caa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3069,7 +3069,8 @@ before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]." | |||
| 3069 | :version "23.2") | 3069 | :version "23.2") |
| 3070 | 3070 | ||
| 3071 | (defcustom kill-do-not-save-duplicates nil | 3071 | (defcustom kill-do-not-save-duplicates nil |
| 3072 | "Do not add a new string to `kill-ring' when it is the same as the last one." | 3072 | "Do not add a new string to `kill-ring' if it duplicates the last one. |
| 3073 | The comparison is done using `equal-including-properties'." | ||
| 3073 | :type 'boolean | 3074 | :type 'boolean |
| 3074 | :group 'killing | 3075 | :group 'killing |
| 3075 | :version "23.2") | 3076 | :version "23.2") |
| @@ -3097,7 +3098,10 @@ argument should still be a \"useful\" string for such uses." | |||
| 3097 | (signal 'args-out-of-range | 3098 | (signal 'args-out-of-range |
| 3098 | (list string "yank-handler specified for empty string")))) | 3099 | (list string "yank-handler specified for empty string")))) |
| 3099 | (unless (and kill-do-not-save-duplicates | 3100 | (unless (and kill-do-not-save-duplicates |
| 3100 | (equal string (car kill-ring))) | 3101 | ;; Due to text properties such as 'yank-handler that |
| 3102 | ;; can alter the contents to yank, comparison using | ||
| 3103 | ;; `equal' is unsafe. | ||
| 3104 | (equal-including-properties string (car kill-ring))) | ||
| 3101 | (if (fboundp 'menu-bar-update-yank-menu) | 3105 | (if (fboundp 'menu-bar-update-yank-menu) |
| 3102 | (menu-bar-update-yank-menu string (and replace (car kill-ring))))) | 3106 | (menu-bar-update-yank-menu string (and replace (car kill-ring))))) |
| 3103 | (when save-interprogram-paste-before-kill | 3107 | (when save-interprogram-paste-before-kill |
| @@ -3108,10 +3112,10 @@ argument should still be a \"useful\" string for such uses." | |||
| 3108 | (nreverse interprogram-paste) | 3112 | (nreverse interprogram-paste) |
| 3109 | (list interprogram-paste))) | 3113 | (list interprogram-paste))) |
| 3110 | (unless (and kill-do-not-save-duplicates | 3114 | (unless (and kill-do-not-save-duplicates |
| 3111 | (equal s (car kill-ring))) | 3115 | (equal-including-properties s (car kill-ring))) |
| 3112 | (push s kill-ring)))))) | 3116 | (push s kill-ring)))))) |
| 3113 | (unless (and kill-do-not-save-duplicates | 3117 | (unless (and kill-do-not-save-duplicates |
| 3114 | (equal string (car kill-ring))) | 3118 | (equal-including-properties string (car kill-ring))) |
| 3115 | (if (and replace kill-ring) | 3119 | (if (and replace kill-ring) |
| 3116 | (setcar kill-ring string) | 3120 | (setcar kill-ring string) |
| 3117 | (push string kill-ring) | 3121 | (push string kill-ring) |