mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-23 10:34:07 +00:00
Fix usage of remove-text-properties
* lisp/allout-widgets.el (allout-decorate-item-icon): * lisp/emacs-lisp/chart.el (chart-goto-xy): * lisp/forms.el (forms--make-format) (forms--make-format-elt-using-text-properties): * lisp/htmlfontify.el (hfy-unmark-trailing-whitespace): * lisp/net/newst-plainview.el (newsticker-hide-entry) (newsticker-show-entry): * lisp/nxml/nxml-mode.el (nxml-cleanup): * lisp/obsolete/longlines.el (longlines-unshow-hard-newlines) (longlines-encode-region): * lisp/org/ob-exp.el (org-babel-exp-process-buffer): * lisp/org/org-agenda.el (org-agenda-show-new-time): * lisp/progmodes/cc-defs.el (c-clear-char-property-with-value-function) (c-clear-char-property-with-value-on-char-function): * lisp/progmodes/ebrowse.el (ebrowse--hide): * lisp/progmodes/gdb-mi.el (gdb-send): * lisp/progmodes/idlw-shell.el (idlwave-retrieve-expression-from-level): * lisp/progmodes/make-mode.el (makefile-fill-paragraph): * lisp/progmodes/prog-mode.el (prettify-symbols--post-command-hook): * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): * lisp/tmm.el (tmm-remove-inactive-mouse-face): Always pass an explicit plist to remove-text-properties. * lisp/dired.el (dired--unhide): * lisp/facemenu.el (facemenu-add-face): * lisp/htmlfontify.el (hfy-fontify-buffer): * lisp/iimage.el (iimage-mode-buffer): * lisp/image-file.el (image-file-yank-handler): * lisp/progmodes/prog-mode.el (prettify-symbols--compose-symbol): * lisp/textmodes/tex-mode.el (latex-env-before-change): * test/src/undo-tests.el (undo-test0): Use remove-list-of-text-properties in place of remove-text-properties where appropriate.
This commit is contained in:
parent
6a77aa4a2c
commit
2267110b6f
@ -1966,7 +1966,7 @@ reapplying this method will rectify the glyphs."
|
||||
;; XXX we strip the prior properties without even checking if
|
||||
;; the prior bullet was distinctive, because the widget
|
||||
;; provisions to convey that info is disappearing, sigh.
|
||||
(remove-text-properties icon-end (1+ icon-end) '(display))
|
||||
(remove-text-properties icon-end (1+ icon-end) '(display nil))
|
||||
(setq distinctive-start icon-end distinctive-end icon-end)
|
||||
(widget-put item-widget :distinctive-start distinctive-start)
|
||||
(widget-put item-widget :distinctive-end distinctive-end))
|
||||
|
@ -2560,7 +2560,7 @@ See options: `dired-hide-details-hide-symlink-targets' and
|
||||
;; approximate ("anywhere on the line is fine").
|
||||
;; FIXME: This also removes other invisible properties!
|
||||
(save-excursion
|
||||
(remove-text-properties
|
||||
(remove-list-of-text-properties
|
||||
(progn (goto-char start) (line-end-position))
|
||||
(progn (goto-char end) (line-end-position))
|
||||
'(invisible))))
|
||||
|
@ -518,7 +518,7 @@ cons cells of the form (NAME . NUM). See `sort' for more details."
|
||||
(or (= (move-to-column x) x)
|
||||
(let ((p (point)))
|
||||
(indent-to x)
|
||||
(remove-text-properties p (point) '(face))))))
|
||||
(remove-text-properties p (point) '(face nil))))))
|
||||
|
||||
(defun chart-zap-chars (n)
|
||||
"Zap up to N chars without deleting EOLs."
|
||||
|
@ -732,7 +732,7 @@ effect. See `facemenu-remove-face-function'."
|
||||
(if facemenu-remove-face-function
|
||||
(funcall facemenu-remove-face-function start end)
|
||||
(if (and start (< start end))
|
||||
(remove-text-properties start end '(face default))
|
||||
(remove-list-of-text-properties start end '(face))
|
||||
(facemenu-set-self-insert-face 'default))))
|
||||
(facemenu-add-face-function
|
||||
(save-excursion
|
||||
|
@ -933,7 +933,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
'(front-sticky (read-only cursor-intangible)))))
|
||||
;; Prevent insertion after the last text.
|
||||
(remove-text-properties (1- (point)) (point)
|
||||
'(rear-nonsticky)))
|
||||
'(rear-nonsticky nil)))
|
||||
(setq forms--iif-start nil))
|
||||
`(lambda (arg)
|
||||
,@(apply 'append
|
||||
@ -998,7 +998,7 @@ Commands: Equivalent keys in read-only mode:
|
||||
;; '(front-sticky (read-only))))))
|
||||
;; ;; Prevent insertion after the last text.
|
||||
;; (remove-text-properties (1- (point)) (point)
|
||||
;; '(rear-nonsticky)))
|
||||
;; '(rear-nonsticky nil)))
|
||||
;;
|
||||
;; ;; wrap up
|
||||
;; (setq forms--iif-start nil)
|
||||
|
@ -1589,7 +1589,7 @@ Do not record undo information during evaluation of BODY."
|
||||
(when show-trailing-whitespace
|
||||
(hfy-save-buffer-state nil
|
||||
(remove-text-properties (point-min) (point-max)
|
||||
'(hfy-show-trailing-whitespace)))))
|
||||
'(hfy-show-trailing-whitespace nil)))))
|
||||
|
||||
(defun hfy-begin-span (style text-block text-id text-begins-block-p)
|
||||
"Default handler to begin a span of text.
|
||||
@ -1677,7 +1677,8 @@ FILE, if set, is the file name."
|
||||
(copy-to-buffer html-buffer (point-min) (point-max))
|
||||
(set-buffer html-buffer)
|
||||
;; rip out props that could interfere with our htmlization of the buffer:
|
||||
(remove-text-properties (point-min) (point-max) hfy-ignored-properties)
|
||||
(remove-list-of-text-properties (point-min) (point-max)
|
||||
hfy-ignored-properties)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; at this point, html-buffer retains the fontification of the parent:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -138,8 +138,9 @@ Examples of image filename patterns to match:
|
||||
keymap ,image-map
|
||||
modification-hooks
|
||||
(iimage-modification-hook)))
|
||||
(remove-text-properties (match-beginning 0) (match-end 0)
|
||||
'(display modification-hooks))))))))))
|
||||
(remove-list-of-text-properties
|
||||
(match-beginning 0) (match-end 0)
|
||||
'(display modification-hooks))))))))))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode iimage-mode nil
|
||||
|
@ -140,7 +140,7 @@ absolute file name and number of characters inserted."
|
||||
"Yank handler for inserting an image into a buffer."
|
||||
(let ((len (length string))
|
||||
(image (get-text-property 0 'display string)))
|
||||
(remove-text-properties 0 len yank-excluded-properties string)
|
||||
(remove-list-of-text-properties 0 len yank-excluded-properties string)
|
||||
(if (consp image)
|
||||
(add-text-properties 0
|
||||
(or (next-single-property-change 0 'image-counter string)
|
||||
|
@ -1002,7 +1002,7 @@ not get changed."
|
||||
;; toggle
|
||||
(add-text-properties pos1 pos2
|
||||
(list 'invisible org-inv-prop))
|
||||
(remove-text-properties pos1 pos2 '(org-invisible))))))
|
||||
(remove-text-properties pos1 pos2 '(org-invisible nil))))))
|
||||
(newsticker--buffer-redraw))
|
||||
|
||||
(defun newsticker-show-entry ()
|
||||
@ -1028,7 +1028,7 @@ not get changed."
|
||||
;; toggle
|
||||
(add-text-properties pos1 pos2
|
||||
(list 'invisible org-inv-prop))
|
||||
(remove-text-properties pos1 pos2 '(org-invisible))))))
|
||||
(remove-text-properties pos1 pos2 '(org-invisible nil))))))
|
||||
(newsticker--buffer-redraw))
|
||||
|
||||
(defun newsticker-toggle-auto-narrow-to-feed ()
|
||||
|
@ -561,7 +561,7 @@ Many aspects this mode can be customized using
|
||||
(widen)
|
||||
(with-silent-modifications
|
||||
(nxml-with-invisible-motion
|
||||
(remove-text-properties (point-min) (point-max) '(face)))))
|
||||
(remove-text-properties (point-min) (point-max) '(face nil)))))
|
||||
(remove-hook 'change-major-mode-hook #'nxml-cleanup t))
|
||||
|
||||
(defun nxml-degrade (context err)
|
||||
|
@ -248,7 +248,7 @@ With optional argument ARG, make the hard newlines invisible again."
|
||||
(inhibit-modification-hooks t)
|
||||
buffer-file-name buffer-file-truename)
|
||||
(while pos
|
||||
(remove-text-properties pos (1+ pos) '(display))
|
||||
(remove-text-properties pos (1+ pos) '(display nil))
|
||||
(setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))
|
||||
(restore-buffer-modified-p mod)))
|
||||
|
||||
@ -387,7 +387,7 @@ compatibility with `format-alist', and is ignored."
|
||||
(goto-char (1+ pos))
|
||||
(insert-and-inherit " ")
|
||||
(delete-region pos (1+ pos))
|
||||
(remove-text-properties pos (1+ pos) 'hard))))
|
||||
(remove-text-properties pos (1+ pos) '(hard nil)))))
|
||||
(set-buffer-modified-p mod)
|
||||
end)))
|
||||
|
||||
|
@ -282,7 +282,8 @@ this template."
|
||||
(set-marker begin nil)
|
||||
(set-marker end nil)))))
|
||||
(kill-buffer org-babel-exp-reference-buffer)
|
||||
(remove-text-properties (point-min) (point-max) '(org-reference)))))))
|
||||
(remove-text-properties (point-min) (point-max)
|
||||
'(org-reference nil)))))))
|
||||
|
||||
(defun org-babel-exp-do-export (info type &optional hash)
|
||||
"Return a string with the exported content of a code block.
|
||||
|
@ -9230,7 +9230,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
|
||||
(goto-char (point-max))
|
||||
(while (not (bobp))
|
||||
(when (equal marker (org-get-at-bol 'org-marker))
|
||||
(remove-text-properties (point-at-bol) (point-at-eol) '(display))
|
||||
(remove-text-properties (point-at-bol) (point-at-eol) '(display nil))
|
||||
(org-move-to-column (- (window-width) (length stamp)) t)
|
||||
(add-text-properties
|
||||
(1- (point)) (point-at-eol)
|
||||
|
@ -1291,7 +1291,7 @@ been put there by c-put-char-property. POINT remains unchanged."
|
||||
(when (and (fboundp 'syntax-ppss) (eq property 'syntax-table))
|
||||
(setq c-syntax-table-hwm (min c-syntax-table-hwm place)))
|
||||
(setq end-place (c-next-single-property-change place property nil to))
|
||||
(remove-text-properties place end-place (cons property nil))
|
||||
(remove-text-properties place end-place (list property nil))
|
||||
;; Do we have to do anything with stickiness here?
|
||||
(setq place end-place))))
|
||||
|
||||
@ -1375,7 +1375,7 @@ property, or nil."
|
||||
(setq place (c-next-single-property-change place property nil to)))
|
||||
(< place to))
|
||||
(when (eq (char-after place) char)
|
||||
(remove-text-properties place (1+ place) (cons property nil))
|
||||
(remove-text-properties place (1+ place) (list property nil))
|
||||
(or first
|
||||
(progn (setq first place)
|
||||
(when (eq property 'syntax-table)
|
||||
|
@ -1383,7 +1383,7 @@ Pop to member buffer if no prefix ARG, to tree buffer otherwise."
|
||||
|
||||
(defun ebrowse--unhide (start end)
|
||||
;; FIXME: This also removes other invisible properties!
|
||||
(remove-text-properties start end '(invisible)))
|
||||
(remove-text-properties start end '(invisible nil)))
|
||||
|
||||
;;; Misc tree buffer commands
|
||||
|
||||
|
@ -1794,7 +1794,7 @@ commands to be prefixed by \"-interpreter-exec console\".")
|
||||
"A comint send filter for gdb."
|
||||
(with-current-buffer gud-comint-buffer
|
||||
(let ((inhibit-read-only t))
|
||||
(remove-text-properties (point-min) (point-max) '(face))))
|
||||
(remove-text-properties (point-min) (point-max) '(face nil))))
|
||||
;; mimic <RET> key to repeat previous command in GDB
|
||||
(when (= gdb-control-level 0)
|
||||
(if (not (string= "" string))
|
||||
|
@ -3120,7 +3120,7 @@ versions of IDL."
|
||||
fetch-start start)
|
||||
(setq fetch-end (next-single-property-change fetch-start 'fetch expr)))
|
||||
(unless fetch-end (setq fetch-end (length expr)))
|
||||
(remove-text-properties fetch-start fetch-end '(fetch) expr)
|
||||
(remove-text-properties fetch-start fetch-end '(fetch nil) expr)
|
||||
(setq expr (concat (substring expr 0 fetch-start)
|
||||
(format "(routine_names('%s',fetch=%d))"
|
||||
(substring expr fetch-start fetch-end)
|
||||
|
@ -1313,7 +1313,7 @@ Fill comments, backslashed lines, and variable definitions specially."
|
||||
;; which back-to-indentation (called via fill-newline ->
|
||||
;; fill-indent-to-left-margin -> indent-line-to) thinks are real code
|
||||
;; (bug#13179).
|
||||
(remove-text-properties (point-min) (point-max) '(syntax-table))
|
||||
(remove-text-properties (point-min) (point-max) '(syntax-table nil))
|
||||
(let ((fill-paragraph-function nil)
|
||||
;; Adjust fill-column to allow space for the backslash.
|
||||
(fill-column (- fill-column 1)))
|
||||
|
@ -138,9 +138,10 @@ Regexp match data 0 specifies the characters to be composed."
|
||||
;; No composition for you. Let's actually remove any
|
||||
;; composition we may have added earlier and which is now
|
||||
;; incorrect.
|
||||
(remove-text-properties start end '(composition
|
||||
prettify-symbols-start
|
||||
prettify-symbols-end))))
|
||||
(remove-list-of-text-properties start end
|
||||
'(composition
|
||||
prettify-symbols-start
|
||||
prettify-symbols-end))))
|
||||
;; Return nil because we're not adding any face property.
|
||||
nil)
|
||||
|
||||
@ -191,7 +192,7 @@ on the symbol."
|
||||
(e (apply #'max e)))
|
||||
(with-silent-modifications
|
||||
(setq prettify-symbols--current-symbol-bounds (list s e))
|
||||
(remove-text-properties s e '(composition))))))
|
||||
(remove-text-properties s e '(composition nil))))))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode prettify-symbols-mode
|
||||
|
@ -1858,7 +1858,7 @@ It will be properly highlighted even when the call omits parens.")
|
||||
"Syntactic keywords for Ruby mode. See `syntax-propertize-function'."
|
||||
(let (case-fold-search)
|
||||
(goto-char start)
|
||||
(remove-text-properties start end '(ruby-expansion-match-data))
|
||||
(remove-text-properties start end '(ruby-expansion-match-data nil))
|
||||
(ruby-syntax-propertize-heredoc end)
|
||||
(ruby-syntax-enclosing-percent-literal end)
|
||||
(funcall
|
||||
|
@ -729,7 +729,7 @@ automatically inserts its partner."
|
||||
(condition-case err
|
||||
(with-silent-modifications
|
||||
;; Remove properties even if don't find a pair.
|
||||
(remove-text-properties
|
||||
(remove-list-of-text-properties
|
||||
(previous-single-property-change (1+ start) 'latex-env-pair)
|
||||
(next-single-property-change start 'latex-env-pair)
|
||||
'(latex-env-pair))
|
||||
|
@ -378,7 +378,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'."
|
||||
(while (not (eobp))
|
||||
(setq next (next-single-char-property-change (point) 'mouse-face))
|
||||
(when (looking-at inactive-string)
|
||||
(remove-text-properties (point) next '(mouse-face))
|
||||
(remove-text-properties (point) next '(mouse-face nil))
|
||||
(add-text-properties (point) next '(face tmm-inactive)))
|
||||
(goto-char next)))
|
||||
(set-buffer-modified-p nil)))
|
||||
|
@ -72,7 +72,7 @@
|
||||
(undo-boundary)
|
||||
(put-text-property (point-min) (point-max) 'face 'bold)
|
||||
(undo-boundary)
|
||||
(remove-text-properties (point-min) (point-max) '(face default))
|
||||
(remove-list-of-text-properties (point-min) (point-max) '(face))
|
||||
(undo-boundary)
|
||||
(set-buffer-multibyte (not enable-multibyte-characters))
|
||||
(undo-boundary)
|
||||
|
Loading…
Reference in New Issue
Block a user