aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Kaludercic2024-08-26 22:41:26 +0200
committerPhilip Kaludercic2024-09-02 22:55:32 +0200
commitd277123f4bf855f0d055d283a42166f123fa1fde (patch)
treec06e53b21ff078baf039f02e04cd13f057395d49
parent92ea393a16e5c99a8860dab368c6ca3ca6abc3c5 (diff)
downloademacs-d277123f4bf855f0d055d283a42166f123fa1fde.tar.gz
emacs-d277123f4bf855f0d055d283a42166f123fa1fde.zip
; Improve robustness of 'help-fns-edit-variable'
* lisp/help-fns.el (help-fns-edit-variable): Extract the text property directly at point instead of trying to determine the variable at point and always assuming there is one. (Bug#71374)
-rw-r--r--lisp/help-fns.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 3d3b841d827..e1daa8977f0 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1530,9 +1530,8 @@ it is displayed along with the global value."
1530 "Edit the variable under point." 1530 "Edit the variable under point."
1531 (declare (completion ignore)) 1531 (declare (completion ignore))
1532 (interactive) 1532 (interactive)
1533 (let* ((val (thing-at-point 'sexp)) 1533 (let ((var (get-text-property (point) 'help-fns--edit-variable)))
1534 (var (get-text-property 0 'help-fns--edit-variable val))) 1534 (unless var
1535 (unless val
1536 (error "No variable under point")) 1535 (error "No variable under point"))
1537 (let ((str (read-string-from-buffer 1536 (let ((str (read-string-from-buffer
1538 (format ";; Edit the `%s' variable." (nth 0 var)) 1537 (format ";; Edit the `%s' variable." (nth 0 var))