aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2003-01-19 00:27:11 +0000
committerKim F. Storm2003-01-19 00:27:11 +0000
commit18232c161dbcb653dcc3992b9ef4bf82d3d496e1 (patch)
treee3fdba78fcaf3f677ea51a9375696d47e864f76f
parentffb6ced1ce4324a1ef7a1a1cef3bc2de58865a0e (diff)
downloademacs-18232c161dbcb653dcc3992b9ef4bf82d3d496e1.tar.gz
emacs-18232c161dbcb653dcc3992b9ef4bf82d3d496e1.zip
New yank-handler property.
-rw-r--r--etc/NEWS58
1 files changed, 55 insertions, 3 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 295d688275d..46f2ab08bbc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1459,13 +1459,65 @@ The new function `remove-list-of-text-properties' is almost the same
1459as `remove-text-properties'. The only difference is that it takes 1459as `remove-text-properties'. The only difference is that it takes
1460a list of property names as argument rather than a property list. 1460a list of property names as argument rather than a property list.
1461 1461
1462** New functions insert-for-yank and insert-buffer-substring-as-yank. 1462** New function insert-for-yank.
1463 1463
1464These functions work like `insert' and `insert-buffer-substring', but 1464This function normally works like `insert' but removes the text
1465removes the text properties in the `yank-excluded-properties' list. 1465properties in the `yank-excluded-properties' list. However, if the
1466inserted text has a `yank-handler' text property on the first
1467character of the string, the insertion of the text may be modified in
1468a number of ways. See the description of `yank-handler' below.
1469
1470** New function insert-buffer-substring-as-yank.
1471
1472This function works like `insert-buffer-substring', but removes the
1473text properties in the `yank-excluded-properties' list.
1466 1474
1467** New function insert-buffer-substring-no-properties. 1475** New function insert-buffer-substring-no-properties.
1468 1476
1477This function is like insert-buffer-substring, but removes all
1478text properties from the inserted substring.
1479
1480** New `yank-handler' text property may be used to control how
1481previously killed text on the kill-ring is reinserted.
1482
1483The value of the yank-handler property must be a list with one to five
1484elements with the following format:
1485 (FUNCTION PARAM NOEXCLUDE UNDO COMMAND).
1486
1487The `insert-for-yank' function looks for a yank-handler property on
1488the first character on its string argument (typically the first
1489element on the kill-ring). If a yank-handler property is found,
1490the normal behaviour of `insert-for-yank' is modified in various ways:
1491
1492 When FUNCTION is present and non-nil, it is called instead of `insert'
1493to insert the string. FUNCTION takes one argument--the object to insert.
1494 If PARAM is present and non-nil, it replaces STRING as the object
1495passed to FUNCTION (or `insert'); for example, if FUNCTION is
1496`yank-rectangle', PARAM should be a list of strings to insert as a
1497rectangle.
1498 If NOEXCLUDE is present and non-nil, the normal removal of the
1499yank-excluded-properties is not performed; instead FUNCTION is
1500responsible for removing those properties. This may be necessary
1501if FUNCTION adjusts point before or after inserting the object.
1502 If UNDO is present and non-nil, it is a function that will be called
1503by `yank-pop' to undo the insertion of the current object. It is
1504called with two arguments, the start and end of the current region.
1505FUNCTION may set `yank-undo-function' to override the UNDO value.
1506 If COMMAND is present and non-nil, `this-command' is set to COMMAND
1507after calling FUNCTION (or insert). Note that setting `this-command'
1508to a value different from `yank' will prevent `yank-pop' from undoing
1509this yank.
1510
1511*** The functions kill-new, kill-append, and kill-region now has an
1512optional third argument to specify the yank-handler text property
1513to put on the killed text.
1514
1515*** The function yank-pop will now use a non-nil value of the variable
1516`yank-undo-function' (instead of delete-region) to undo the previous
1517yank or yank-pop command (or a call to insert-for-yank). The function
1518insert-for-yank automatically sets that variable according to the UNDO
1519element of the string argument's yank-handler text property if present.
1520
1469** New function display-supports-face-attributes-p may be used to test 1521** New function display-supports-face-attributes-p may be used to test
1470whether a given set of face attributes is actually displayable. 1522whether a given set of face attributes is actually displayable.
1471 1523