1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

Fix region-extract-function compilation warning

* lisp/simple.el (region-extract-function): Clean up the logic
slightly to avoid a warning.
This commit is contained in:
Lars Ingebrigtsen 2022-08-18 23:05:17 +02:00
parent 088171e053
commit 054f553b9c

View File

@ -1402,15 +1402,17 @@ instead of deleted."
:version "24.1")
(setq region-extract-function
(lambda (method)
(when (region-beginning)
(cond
((eq method 'bounds)
(list (cons (region-beginning) (region-end))))
((eq method 'delete-only)
(delete-region (region-beginning) (region-end)))
(t
(filter-buffer-substring (region-beginning) (region-end) method))))))
(lambda (method)
;; This call either signals an error (if there is no region)
;; or returns a number.
(let ((beg (region-beginning)))
(cond
((eq method 'bounds)
(list (cons beg (region-end))))
((eq method 'delete-only)
(delete-region beg (region-end)))
(t
(filter-buffer-substring beg (region-end) method))))))
(defvar region-insert-function
(lambda (lines)