aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2003-01-27 21:44:48 +0000
committerKim F. Storm2003-01-27 21:44:48 +0000
commit2a262563661b44a04d25472fe82c843e2fa53074 (patch)
tree079a5251e1aca0a436ab16d8354d363ecfb11bfa
parentcee84394912ad67b8c15ae1a81490df37ba03e85 (diff)
downloademacs-2a262563661b44a04d25472fe82c843e2fa53074.tar.gz
emacs-2a262563661b44a04d25472fe82c843e2fa53074.zip
(kill-new): Improve doc string for yank-handler.
Signal args-out-of-range error if yank-handler is specified for an empty string.
-rw-r--r--lisp/simple.el24
1 files changed, 17 insertions, 7 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index b4d1d609bc7..ac531e9674c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1764,13 +1764,23 @@ Optional second argument REPLACE non-nil means that STRING will replace
1764the front of the kill ring, rather than being added to the list. 1764the front of the kill ring, rather than being added to the list.
1765 1765
1766Optional third arguments YANK-HANDLER controls how the STRING is later 1766Optional third arguments YANK-HANDLER controls how the STRING is later
1767inserted into a buffer; see `insert-for-yank' for details." 1767inserted into a buffer; see `insert-for-yank' for details.
1768 (when (> (length string) 0) 1768When a yank handler is specified, STRING must be non-empty (the yank
1769 (if yank-handler 1769handler is stored as a `yank-handler'text property on STRING).
1770 (put-text-property 0 1 'yank-handler yank-handler string) 1770
1771 (remove-text-properties 0 1 '(yank-handler nil) string))) 1771When the yank handler has a non-nil PARAM element, the original STRING
1772 (and (fboundp 'menu-bar-update-yank-menu) 1772argument is not used by `insert-for-yank'. However, since Lisp code
1773 (menu-bar-update-yank-menu string (and replace (car kill-ring)))) 1773may access and use elements from the kill-ring directly, the STRING
1774argument should still be a \"useful\" string for such uses."
1775 (if (> (length string) 0)
1776 (if yank-handler
1777 (put-text-property 0 1 'yank-handler yank-handler string)
1778 (remove-list-of-text-properties 0 1 '(yank-handler) string))
1779 (if yank-handler
1780 (signal 'args-out-of-range
1781 (list string "yank-handler specified for empty string"))))
1782 (if (fboundp 'menu-bar-update-yank-menu)
1783 (menu-bar-update-yank-menu string (and replace (car kill-ring))))
1774 (if (and replace kill-ring) 1784 (if (and replace kill-ring)
1775 (setcar kill-ring string) 1785 (setcar kill-ring string)
1776 (setq kill-ring (cons string kill-ring)) 1786 (setq kill-ring (cons string kill-ring))