diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 45daf99f614..936037f5caa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -893,16 +893,23 @@ that uses or sets the mark." | |||
| 893 | ;; Counting lines, one way or another. | 893 | ;; Counting lines, one way or another. |
| 894 | 894 | ||
| 895 | (defun goto-line (line &optional buffer) | 895 | (defun goto-line (line &optional buffer) |
| 896 | "Goto LINE, counting from line 1 at beginning of buffer. | 896 | "Go to LINE, counting from line 1 at beginning of buffer. |
| 897 | Normally, move point in the current buffer, and leave mark at the | 897 | If called interactively, a numeric prefix argument specifies |
| 898 | previous position. With just \\[universal-argument] as argument, | 898 | LINE; without a numeric prefix argument, read LINE from the |
| 899 | move point in the most recently selected other buffer, and switch to it. | 899 | minibuffer. |
| 900 | |||
| 901 | If optional argument BUFFER is non-nil, switch to that buffer and | ||
| 902 | move to line LINE there. If called interactively with \\[universal-argument] | ||
| 903 | as argument, BUFFER is the most recently selected other buffer. | ||
| 900 | 904 | ||
| 901 | If there's a number in the buffer at point, it is the default for LINE. | 905 | Prior to moving point, this function sets the mark (without |
| 906 | activating it), unless Transient Mark mode is enabled and the | ||
| 907 | mark is already active. | ||
| 902 | 908 | ||
| 903 | This function is usually the wrong thing to use in a Lisp program. | 909 | This function is usually the wrong thing to use in a Lisp program. |
| 904 | What you probably want instead is something like: | 910 | What you probably want instead is something like: |
| 905 | (goto-char (point-min)) (forward-line (1- N)) | 911 | (goto-char (point-min)) |
| 912 | (forward-line (1- N)) | ||
| 906 | If at all possible, an even better solution is to use char counts | 913 | If at all possible, an even better solution is to use char counts |
| 907 | rather than line counts." | 914 | rather than line counts." |
| 908 | (interactive | 915 | (interactive |
| @@ -3062,7 +3069,8 @@ before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]." | |||
| 3062 | :version "23.2") | 3069 | :version "23.2") |
| 3063 | 3070 | ||
| 3064 | (defcustom kill-do-not-save-duplicates nil | 3071 | (defcustom kill-do-not-save-duplicates nil |
| 3065 | "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'." | ||
| 3066 | :type 'boolean | 3074 | :type 'boolean |
| 3067 | :group 'killing | 3075 | :group 'killing |
| 3068 | :version "23.2") | 3076 | :version "23.2") |
| @@ -3090,7 +3098,10 @@ argument should still be a \"useful\" string for such uses." | |||
| 3090 | (signal 'args-out-of-range | 3098 | (signal 'args-out-of-range |
| 3091 | (list string "yank-handler specified for empty string")))) | 3099 | (list string "yank-handler specified for empty string")))) |
| 3092 | (unless (and kill-do-not-save-duplicates | 3100 | (unless (and kill-do-not-save-duplicates |
| 3093 | (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))) | ||
| 3094 | (if (fboundp 'menu-bar-update-yank-menu) | 3105 | (if (fboundp 'menu-bar-update-yank-menu) |
| 3095 | (menu-bar-update-yank-menu string (and replace (car kill-ring))))) | 3106 | (menu-bar-update-yank-menu string (and replace (car kill-ring))))) |
| 3096 | (when save-interprogram-paste-before-kill | 3107 | (when save-interprogram-paste-before-kill |
| @@ -3101,10 +3112,10 @@ argument should still be a \"useful\" string for such uses." | |||
| 3101 | (nreverse interprogram-paste) | 3112 | (nreverse interprogram-paste) |
| 3102 | (list interprogram-paste))) | 3113 | (list interprogram-paste))) |
| 3103 | (unless (and kill-do-not-save-duplicates | 3114 | (unless (and kill-do-not-save-duplicates |
| 3104 | (equal s (car kill-ring))) | 3115 | (equal-including-properties s (car kill-ring))) |
| 3105 | (push s kill-ring)))))) | 3116 | (push s kill-ring)))))) |
| 3106 | (unless (and kill-do-not-save-duplicates | 3117 | (unless (and kill-do-not-save-duplicates |
| 3107 | (equal string (car kill-ring))) | 3118 | (equal-including-properties string (car kill-ring))) |
| 3108 | (if (and replace kill-ring) | 3119 | (if (and replace kill-ring) |
| 3109 | (setcar kill-ring string) | 3120 | (setcar kill-ring string) |
| 3110 | (push string kill-ring) | 3121 | (push string kill-ring) |