Fix copy-by-mouse in *Backtrace* buffers

* lisp/emacs-lisp/backtrace.el (backtrace--filter-visible):
Support BEG and END in reverse order.  Patch by Jakub
T. Jankiewicz <jcubic@jcubic.pl>.  (Bug#81365)
This commit is contained in:
Eli Zaretskii 2026-07-13 15:13:51 +03:00
parent eebc9c7fe7
commit b6412271e1

View file

@ -813,7 +813,11 @@ Fall back to `prin1' if there is an error."
(defun backtrace--filter-visible (beg end &optional _delete)
"Return the visible text between BEG and END."
(let ((result ""))
(let ((result "")
(b (min beg end))
(e (max beg end)))
;; Make sure BEG and END are in the correct order.
(setq beg b end e)
(while (< beg end)
(let ((next (next-single-char-property-change beg 'invisible)))
(unless (get-char-property beg 'invisible)