[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master bfa958bb2c8: Correct the XEmacs version of c-put-char-properties
From: |
Alan Mackenzie |
Subject: |
master bfa958bb2c8: Correct the XEmacs version of c-put-char-properties |
Date: |
Tue, 12 Sep 2023 10:47:26 -0400 (EDT) |
branch: master
commit bfa958bb2c88e84d8a2748eba1f91e26c26f5da9
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>
Correct the XEmacs version of c-put-char-properties
* lisp/progmodes/cc-defs.el (c-put-char-properties): Use the
put-text-property interface rather than make-extent for XEmacs
as well as Emacs.
---
lisp/progmodes/cc-defs.el | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index 2cbe9ca7e92..6e4b570c2e8 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1298,27 +1298,19 @@ MODE is either a mode symbol or a list of mode symbols."
(most-positive-fixnum))))
(defmacro c-put-char-properties (from to property value)
- ;; FIXME!!! Doc comment here!
+ ;; Put the given PROPERTY with the given VALUE on the characters between
+ ;; FROM and TO. PROPERTY is assumed to be constant. The return value is
+ ;; undefined.
+ ;;
+ ;; This macro does hidden buffer changes.
(declare (debug t))
(setq property (eval property))
- `(let ((-to- ,to) (-from- ,from))
- ,(if c-use-extents
- ;; XEmacs
- `(progn
- (map-extents (lambda (ext ignored)
- (delete-extent ext))
- nil -from- -to- nil nil ',property)
- (set-extent-properties (make-extent -from- -to-)
- (cons property
- (cons ,value
- '(start-open t
- end-open t)))))
- ;; Emacs
- `(progn
+ `(let ((-from- ,from))
+ (progn
,@(when (and (fboundp 'syntax-ppss)
(eq `,property 'syntax-table))
`((setq c-syntax-table-hwm (min c-syntax-table-hwm -from-))))
- (put-text-property -from- -to- ',property ,value)))))
+ (put-text-property -from- ,to ',property ,value))))
(defmacro c-clear-char-properties (from to property)
;; Remove all the occurrences of the given property in the given
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master bfa958bb2c8: Correct the XEmacs version of c-put-char-properties,
Alan Mackenzie <=