diff options
| author | Stefan Monnier | 2010-11-17 21:09:41 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-11-17 21:09:41 -0500 |
| commit | 9fca7811a8f085b4a75b197caec60886fdae324e (patch) | |
| tree | dcc8f97d5decc562e3534b85d897e3048eeee34b | |
| parent | e2f454c4bed74e7699e71da161db37a4dd1317de (diff) | |
| download | emacs-9fca7811a8f085b4a75b197caec60886fdae324e.tar.gz emacs-9fca7811a8f085b4a75b197caec60886fdae324e.zip | |
Make the yank-handler argument obsolete.
* simple.el (kill-new, kill-append, kill-region):
* comint.el (comint-kill-region): Make the yank-handler argument obsolete.
| -rw-r--r-- | etc/NEWS | 1 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/comint.el | 1 | ||||
| -rw-r--r-- | lisp/simple.el | 21 |
4 files changed, 12 insertions, 16 deletions
| @@ -100,6 +100,7 @@ starting from the first line of text below the header line. | |||
| 100 | The old names are obsolete. | 100 | The old names are obsolete. |
| 101 | ** The use of unintern without an obarray arg is declared obsolete. | 101 | ** The use of unintern without an obarray arg is declared obsolete. |
| 102 | ** The function `princ-list' is declared obsolete. | 102 | ** The function `princ-list' is declared obsolete. |
| 103 | ** The yank-handler argument to kill-region and friends is declared obsolete. | ||
| 103 | ** New function byte-to-string, like char-to-string but for bytes. | 104 | ** New function byte-to-string, like char-to-string but for bytes. |
| 104 | 105 | ||
| 105 | 106 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ba7c673857..4fb7c84f3c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-11-18 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (kill-new, kill-append, kill-region): | ||
| 4 | * comint.el (comint-kill-region): Make the yank-handler argument obsolete. | ||
| 5 | |||
| 1 | 2010-11-17 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2010-11-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/smie.el (smie-bnf-classify): Signal errors for tokens | 8 | * emacs-lisp/smie.el (smie-bnf-classify): Signal errors for tokens |
diff --git a/lisp/comint.el b/lisp/comint.el index bb43f47b377..ca8f775cf13 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -2641,6 +2641,7 @@ updated using `comint-update-fence', if necessary." | |||
| 2641 | (let ((inhibit-read-only t)) | 2641 | (let ((inhibit-read-only t)) |
| 2642 | (kill-region beg end yank-handler) | 2642 | (kill-region beg end yank-handler) |
| 2643 | (comint-update-fence)))))) | 2643 | (comint-update-fence)))))) |
| 2644 | (set-advertised-calling-convention 'comint-kill-new '(beg end) "23.3") | ||
| 2644 | 2645 | ||
| 2645 | 2646 | ||
| 2646 | ;; Support for source-file processing commands. | 2647 | ;; Support for source-file processing commands. |
diff --git a/lisp/simple.el b/lisp/simple.el index ba7788ead2d..3f4e12133b5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2831,11 +2831,6 @@ If `interprogram-cut-function' is non-nil, apply it to STRING. | |||
| 2831 | Optional second argument REPLACE non-nil means that STRING will replace | 2831 | Optional second argument REPLACE non-nil means that STRING will replace |
| 2832 | the front of the kill ring, rather than being added to the list. | 2832 | the front of the kill ring, rather than being added to the list. |
| 2833 | 2833 | ||
| 2834 | Optional third arguments YANK-HANDLER controls how the STRING is later | ||
| 2835 | inserted into a buffer; see `insert-for-yank' for details. | ||
| 2836 | When a yank handler is specified, STRING must be non-empty (the yank | ||
| 2837 | handler, if non-nil, is stored as a `yank-handler' text property on STRING). | ||
| 2838 | |||
| 2839 | When `save-interprogram-paste-before-kill' and `interprogram-paste-function' | 2834 | When `save-interprogram-paste-before-kill' and `interprogram-paste-function' |
| 2840 | are non-nil, saves the interprogram paste string(s) into `kill-ring' before | 2835 | are non-nil, saves the interprogram paste string(s) into `kill-ring' before |
| 2841 | STRING. | 2836 | STRING. |
| @@ -2872,22 +2867,19 @@ argument should still be a \"useful\" string for such uses." | |||
| 2872 | (setq kill-ring-yank-pointer kill-ring) | 2867 | (setq kill-ring-yank-pointer kill-ring) |
| 2873 | (if interprogram-cut-function | 2868 | (if interprogram-cut-function |
| 2874 | (funcall interprogram-cut-function string (not replace)))) | 2869 | (funcall interprogram-cut-function string (not replace)))) |
| 2870 | (set-advertised-calling-convention | ||
| 2871 | 'kill-new '(string &optional replace) "23.3") | ||
| 2875 | 2872 | ||
| 2876 | (defun kill-append (string before-p &optional yank-handler) | 2873 | (defun kill-append (string before-p &optional yank-handler) |
| 2877 | "Append STRING to the end of the latest kill in the kill ring. | 2874 | "Append STRING to the end of the latest kill in the kill ring. |
| 2878 | If BEFORE-P is non-nil, prepend STRING to the kill. | 2875 | If BEFORE-P is non-nil, prepend STRING to the kill. |
| 2879 | Optional third argument YANK-HANDLER, if non-nil, specifies the | ||
| 2880 | yank-handler text property to be set on the combined kill ring | ||
| 2881 | string. If the specified yank-handler arg differs from the | ||
| 2882 | yank-handler property of the latest kill string, this function | ||
| 2883 | adds the combined string to the kill ring as a new element, | ||
| 2884 | instead of replacing the last kill with it. | ||
| 2885 | If `interprogram-cut-function' is set, pass the resulting kill to it." | 2876 | If `interprogram-cut-function' is set, pass the resulting kill to it." |
| 2886 | (let* ((cur (car kill-ring))) | 2877 | (let* ((cur (car kill-ring))) |
| 2887 | (kill-new (if before-p (concat string cur) (concat cur string)) | 2878 | (kill-new (if before-p (concat string cur) (concat cur string)) |
| 2888 | (or (= (length cur) 0) | 2879 | (or (= (length cur) 0) |
| 2889 | (equal yank-handler (get-text-property 0 'yank-handler cur))) | 2880 | (equal yank-handler (get-text-property 0 'yank-handler cur))) |
| 2890 | yank-handler))) | 2881 | yank-handler))) |
| 2882 | (set-advertised-calling-convention 'kill-append '(string before-p) "23.3") | ||
| 2891 | 2883 | ||
| 2892 | (defcustom yank-pop-change-selection nil | 2884 | (defcustom yank-pop-change-selection nil |
| 2893 | "If non-nil, rotating the kill ring changes the window system selection." | 2885 | "If non-nil, rotating the kill ring changes the window system selection." |
| @@ -2968,11 +2960,7 @@ Supply two arguments, character positions indicating the stretch of text | |||
| 2968 | Any command that calls this function is a \"kill command\". | 2960 | Any command that calls this function is a \"kill command\". |
| 2969 | If the previous command was also a kill command, | 2961 | If the previous command was also a kill command, |
| 2970 | the text killed this time appends to the text killed last time | 2962 | the text killed this time appends to the text killed last time |
| 2971 | to make one entry in the kill ring. | 2963 | to make one entry in the kill ring." |
| 2972 | |||
| 2973 | In Lisp code, optional third arg YANK-HANDLER, if non-nil, | ||
| 2974 | specifies the yank-handler text property to be set on the killed | ||
| 2975 | text. See `insert-for-yank'." | ||
| 2976 | ;; Pass point first, then mark, because the order matters | 2964 | ;; Pass point first, then mark, because the order matters |
| 2977 | ;; when calling kill-append. | 2965 | ;; when calling kill-append. |
| 2978 | (interactive (list (point) (mark))) | 2966 | (interactive (list (point) (mark))) |
| @@ -3004,6 +2992,7 @@ text. See `insert-for-yank'." | |||
| 3004 | (barf-if-buffer-read-only) | 2992 | (barf-if-buffer-read-only) |
| 3005 | ;; If the buffer isn't read-only, the text is. | 2993 | ;; If the buffer isn't read-only, the text is. |
| 3006 | (signal 'text-read-only (list (current-buffer))))))) | 2994 | (signal 'text-read-only (list (current-buffer))))))) |
| 2995 | (set-advertised-calling-convention 'kill-region '(beg end) "23.3") | ||
| 3007 | 2996 | ||
| 3008 | ;; copy-region-as-kill no longer sets this-command, because it's confusing | 2997 | ;; copy-region-as-kill no longer sets this-command, because it's confusing |
| 3009 | ;; to get two copies of the text when the user accidentally types M-w and | 2998 | ;; to get two copies of the text when the user accidentally types M-w and |