aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2023-09-12 14:45:47 +0000
committerAlan Mackenzie2023-09-12 14:45:47 +0000
commitbfa958bb2c88e84d8a2748eba1f91e26c26f5da9 (patch)
tree3cc48259ab22ef2a4dac838df6285afc04b67d2e
parent2b6928edb978c5aeac6f81a1b2d5f38380d5564f (diff)
downloademacs-bfa958bb2c88e84d8a2748eba1f91e26c26f5da9.tar.gz
emacs-bfa958bb2c88e84d8a2748eba1f91e26c26f5da9.zip
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.
-rw-r--r--lisp/progmodes/cc-defs.el24
1 files 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."
1298 (most-positive-fixnum)))) 1298 (most-positive-fixnum))))
1299 1299
1300(defmacro c-put-char-properties (from to property value) 1300(defmacro c-put-char-properties (from to property value)
1301 ;; FIXME!!! Doc comment here! 1301 ;; Put the given PROPERTY with the given VALUE on the characters between
1302 ;; FROM and TO. PROPERTY is assumed to be constant. The return value is
1303 ;; undefined.
1304 ;;
1305 ;; This macro does hidden buffer changes.
1302 (declare (debug t)) 1306 (declare (debug t))
1303 (setq property (eval property)) 1307 (setq property (eval property))
1304 `(let ((-to- ,to) (-from- ,from)) 1308 `(let ((-from- ,from))
1305 ,(if c-use-extents 1309 (progn
1306 ;; XEmacs
1307 `(progn
1308 (map-extents (lambda (ext ignored)
1309 (delete-extent ext))
1310 nil -from- -to- nil nil ',property)
1311 (set-extent-properties (make-extent -from- -to-)
1312 (cons property
1313 (cons ,value
1314 '(start-open t
1315 end-open t)))))
1316 ;; Emacs
1317 `(progn
1318 ,@(when (and (fboundp 'syntax-ppss) 1310 ,@(when (and (fboundp 'syntax-ppss)
1319 (eq `,property 'syntax-table)) 1311 (eq `,property 'syntax-table))
1320 `((setq c-syntax-table-hwm (min c-syntax-table-hwm -from-)))) 1312 `((setq c-syntax-table-hwm (min c-syntax-table-hwm -from-))))
1321 (put-text-property -from- -to- ',property ,value))))) 1313 (put-text-property -from- ,to ',property ,value))))
1322 1314
1323(defmacro c-clear-char-properties (from to property) 1315(defmacro c-clear-char-properties (from to property)
1324 ;; Remove all the occurrences of the given property in the given 1316 ;; Remove all the occurrences of the given property in the given