]> git.eshelyaron.com Git - emacs.git/commitdiff
Correct the XEmacs version of c-put-char-properties
authorAlan Mackenzie <acm@muc.de>
Tue, 12 Sep 2023 14:45:47 +0000 (14:45 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 12 Sep 2023 14:45:47 +0000 (14:45 +0000)
* 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

index 2cbe9ca7e92c45682ffa98e0535a2c227eb365c0..6e4b570c2e83dbf9cb11b49744ac5ffbe5ae9e42 100644 (file)
@@ -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