comparison etc/NEWS @ 49316:1ace047a072a

New yank-handler property.
author Kim F. Storm <storm@cua.dk>
date Sun, 19 Jan 2003 00:27:11 +0000
parents ac42843384b3
children aa7e1948ad31
comparison
equal deleted inserted replaced
49315:7a843709dcda 49316:1ace047a072a
1457 1457
1458 The new function `remove-list-of-text-properties' is almost the same 1458 The new function `remove-list-of-text-properties' is almost the same
1459 as `remove-text-properties'. The only difference is that it takes 1459 as `remove-text-properties'. The only difference is that it takes
1460 a list of property names as argument rather than a property list. 1460 a 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
1464 These functions work like `insert' and `insert-buffer-substring', but 1464 This function normally works like `insert' but removes the text
1465 removes the text properties in the `yank-excluded-properties' list. 1465 properties in the `yank-excluded-properties' list. However, if the
1466 inserted text has a `yank-handler' text property on the first
1467 character of the string, the insertion of the text may be modified in
1468 a number of ways. See the description of `yank-handler' below.
1469
1470 ** New function insert-buffer-substring-as-yank.
1471
1472 This function works like `insert-buffer-substring', but removes the
1473 text 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.
1476
1477 This function is like insert-buffer-substring, but removes all
1478 text properties from the inserted substring.
1479
1480 ** New `yank-handler' text property may be used to control how
1481 previously killed text on the kill-ring is reinserted.
1482
1483 The value of the yank-handler property must be a list with one to five
1484 elements with the following format:
1485 (FUNCTION PARAM NOEXCLUDE UNDO COMMAND).
1486
1487 The `insert-for-yank' function looks for a yank-handler property on
1488 the first character on its string argument (typically the first
1489 element on the kill-ring). If a yank-handler property is found,
1490 the 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'
1493 to 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
1495 passed to FUNCTION (or `insert'); for example, if FUNCTION is
1496 `yank-rectangle', PARAM should be a list of strings to insert as a
1497 rectangle.
1498 If NOEXCLUDE is present and non-nil, the normal removal of the
1499 yank-excluded-properties is not performed; instead FUNCTION is
1500 responsible for removing those properties. This may be necessary
1501 if 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
1503 by `yank-pop' to undo the insertion of the current object. It is
1504 called with two arguments, the start and end of the current region.
1505 FUNCTION may set `yank-undo-function' to override the UNDO value.
1506 If COMMAND is present and non-nil, `this-command' is set to COMMAND
1507 after calling FUNCTION (or insert). Note that setting `this-command'
1508 to a value different from `yank' will prevent `yank-pop' from undoing
1509 this yank.
1510
1511 *** The functions kill-new, kill-append, and kill-region now has an
1512 optional third argument to specify the yank-handler text property
1513 to 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
1517 yank or yank-pop command (or a call to insert-for-yank). The function
1518 insert-for-yank automatically sets that variable according to the UNDO
1519 element of the string argument's yank-handler text property if present.
1468 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
1470 whether a given set of face attributes is actually displayable. 1522 whether a given set of face attributes is actually displayable.
1471 1523
1472 A new predicate `supports' has also been added to the `defface' face 1524 A new predicate `supports' has also been added to the `defface' face