diff options
| author | Eli Zaretskii | 2025-02-22 18:04:04 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-02-22 18:04:04 +0200 |
| commit | 827a91dbf3a45d6c3c620545b5e620ce76e44bb2 (patch) | |
| tree | b45edd0381c08990766b9ac2b59918a20e6b24f0 | |
| parent | 8b6797fa01bf8c8c64bd1f72c1e2475bf2331ad9 (diff) | |
| download | emacs-827a91dbf3a45d6c3c620545b5e620ce76e44bb2.tar.gz emacs-827a91dbf3a45d6c3c620545b5e620ce76e44bb2.zip | |
Make 'text-property-default-nonsticky' buffer-local when set
* src/textprop.c (syms_of_textprop)
<text-property-default-nonsticky>: Make buffer-local when set.
(Bug#76445)
* etc/symbol-releases.eld: Add text-property-default-nonsticky.
* etc/NEWS:
* doc/lispref/text.texi (Sticky Properties): Document the change.
| -rw-r--r-- | doc/lispref/text.texi | 8 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | etc/symbol-releases.eld | 1 | ||||
| -rw-r--r-- | src/textprop.c | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index bada8bd734b..90aa45e8501 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -4135,10 +4135,10 @@ list, properties are rear-sticky @emph{unless} their names are in the | |||
| 4135 | list. | 4135 | list. |
| 4136 | 4136 | ||
| 4137 | @defvar text-property-default-nonsticky | 4137 | @defvar text-property-default-nonsticky |
| 4138 | This variable holds an alist which defines the default rear-stickiness | 4138 | This buffer-local variable holds an alist which defines the default |
| 4139 | of various text properties. Each element has the form | 4139 | rear-stickiness of various text properties in the buffer. Each element |
| 4140 | @code{(@var{property} . @var{nonstickiness})}, and it defines the | 4140 | has the form @code{(@var{property} . @var{nonstickiness})}, and it |
| 4141 | stickiness of a particular text property, @var{property}. | 4141 | defines the stickiness of a particular text property, @var{property}. |
| 4142 | 4142 | ||
| 4143 | If @var{nonstickiness} is non-@code{nil}, this means that the property | 4143 | If @var{nonstickiness} is non-@code{nil}, this means that the property |
| 4144 | @var{property} is rear-nonsticky by default. Since all properties are | 4144 | @var{property} is rear-nonsticky by default. Since all properties are |
| @@ -1306,6 +1306,11 @@ An old alternative name (without the first 'e') has been removed. | |||
| 1306 | +++ | 1306 | +++ |
| 1307 | ** 'read-directory-name' now accepts an optional PREDICATE argument. | 1307 | ** 'read-directory-name' now accepts an optional PREDICATE argument. |
| 1308 | 1308 | ||
| 1309 | +++ | ||
| 1310 | ** 'text-property-default-nonsticky' is now buffer-local. | ||
| 1311 | This variable now becomes buffer-local when set. Use 'setq-default' in | ||
| 1312 | (the unlikely) case you want to change the global value. | ||
| 1313 | |||
| 1309 | --- | 1314 | --- |
| 1310 | ** All the digit characters now have the 'digit' category. | 1315 | ** All the digit characters now have the 'digit' category. |
| 1311 | All the characters whose Unicode general-category is Nd now have the | 1316 | All the characters whose Unicode general-category is Nd now have the |
diff --git a/etc/symbol-releases.eld b/etc/symbol-releases.eld index 645ab77972d..41200581be5 100644 --- a/etc/symbol-releases.eld +++ b/etc/symbol-releases.eld | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | ("22.1" fun version<) | 44 | ("22.1" fun version<) |
| 45 | ("22.1" fun version<=) | 45 | ("22.1" fun version<=) |
| 46 | ("22.1" fun read-number) | 46 | ("22.1" fun read-number) |
| 47 | ("21.1" var text-property-default-nonsticky) | ||
| 47 | 48 | ||
| 48 | ;; Since much of early Emacs source history is lost, these versions are | 49 | ;; Since much of early Emacs source history is lost, these versions are |
| 49 | ;; conservative estimates: the actual version of first appearance may very | 50 | ;; conservative estimates: the actual version of first appearance may very |
diff --git a/src/textprop.c b/src/textprop.c index 30c26ce4809..8fdaafccede 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -2427,6 +2427,7 @@ inherits it if NONSTICKINESS is nil. The `front-sticky' and | |||
| 2427 | by default. */ | 2427 | by default. */ |
| 2428 | Vtext_property_default_nonsticky | 2428 | Vtext_property_default_nonsticky |
| 2429 | = list2 (Fcons (Qsyntax_table, Qt), Fcons (Qdisplay, Qt)); | 2429 | = list2 (Fcons (Qsyntax_table, Qt), Fcons (Qdisplay, Qt)); |
| 2430 | Fmake_variable_buffer_local (Qtext_property_default_nonsticky); | ||
| 2430 | 2431 | ||
| 2431 | interval_insert_behind_hooks = Qnil; | 2432 | interval_insert_behind_hooks = Qnil; |
| 2432 | interval_insert_in_front_hooks = Qnil; | 2433 | interval_insert_in_front_hooks = Qnil; |
| @@ -2444,6 +2445,7 @@ inherits it if NONSTICKINESS is nil. The `front-sticky' and | |||
| 2444 | DEFSYM (Qlocal_map, "local-map"); | 2445 | DEFSYM (Qlocal_map, "local-map"); |
| 2445 | DEFSYM (Qfront_sticky, "front-sticky"); | 2446 | DEFSYM (Qfront_sticky, "front-sticky"); |
| 2446 | DEFSYM (Qrear_nonsticky, "rear-nonsticky"); | 2447 | DEFSYM (Qrear_nonsticky, "rear-nonsticky"); |
| 2448 | DEFSYM (Qtext_property_default_nonsticky, "text-property-default-nonsticky"); | ||
| 2447 | DEFSYM (Qmouse_face, "mouse-face"); | 2449 | DEFSYM (Qmouse_face, "mouse-face"); |
| 2448 | DEFSYM (Qminibuffer_prompt, "minibuffer-prompt"); | 2450 | DEFSYM (Qminibuffer_prompt, "minibuffer-prompt"); |
| 2449 | 2451 | ||