diff options
| author | Kim F. Storm | 2003-01-19 00:27:11 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2003-01-19 00:27:11 +0000 |
| commit | 18232c161dbcb653dcc3992b9ef4bf82d3d496e1 (patch) | |
| tree | e3fdba78fcaf3f677ea51a9375696d47e864f76f | |
| parent | ffb6ced1ce4324a1ef7a1a1cef3bc2de58865a0e (diff) | |
| download | emacs-18232c161dbcb653dcc3992b9ef4bf82d3d496e1.tar.gz emacs-18232c161dbcb653dcc3992b9ef4bf82d3d496e1.zip | |
New yank-handler property.
| -rw-r--r-- | etc/NEWS | 58 |
1 files changed, 55 insertions, 3 deletions
| @@ -1459,13 +1459,65 @@ 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. |
| 1468 | 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. | ||
| 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 | ||