diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2025-03-29 17:53:55 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2025-03-29 17:53:55 -0400 |
commit | a5126f79a163192947acb18a32e199c588be7c4a (patch) | |
tree | 33fa0d9d115e5041bfd0486fa2ffbbbcb76904e6 /lisp/emacs-lisp/cl-lib.el | |
parent | b98fe25c2ee2ac2d82b337c49d1aa1dfed2417eb (diff) | |
parent | 6bcf41c311b220e84f4eb423700f36ac1ddfffa7 (diff) | |
download | emacs-a5126f79a163192947acb18a32e199c588be7c4a.tar.gz emacs-a5126f79a163192947acb18a32e199c588be7c4a.tar.bz2 emacs-a5126f79a163192947acb18a32e199c588be7c4a.zip |
Merge remote-tracking branch 'origin/scratch/replace-region-contents'
Diffstat (limited to 'lisp/emacs-lisp/cl-lib.el')
-rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 4208160bd12..4645b4dffb1 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -154,12 +154,10 @@ to an element already in the list stored in PLACE. `(setq ,place (cl-adjoin ,x ,place ,@keys))) `(cl-callf2 cl-adjoin ,x ,place ,@keys))) -(defun cl--set-buffer-substring (start end val) +(defun cl--set-buffer-substring (start end val &optional inherit) "Delete region from START to END and insert VAL." - (save-excursion (delete-region start end) - (goto-char start) - (insert val) - val)) + (replace-region-contents start end val 0 nil inherit) + val) (defun cl--set-substring (str start end val) (if end (if (< end 0) (incf end (length str))) |