GNU bug report logs -
#71374
[PATCH] Simplify 'help-enable-variable-value-editing' using
Previous Next
Reported by: Philip Kaludercic <philipk <at> posteo.net>
Date: Wed, 5 Jun 2024 07:15:02 UTC
Severity: wishlist
Tags: patch
Done: Philip Kaludercic <philipk <at> posteo.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71374 in the body.
You can then email your comments to 71374 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Wed, 05 Jun 2024 07:15:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Philip Kaludercic <philipk <at> posteo.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 05 Jun 2024 07:15:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The main issue with this patch is that it drops the syntax highlighting
in the *string edit* buffer, but we could fix that in a second patch by
adding support to specify a major mode to inherit from when editing a
string.
[0001-Simplify-'help-enable-variable-value-editing'-usin.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
Philip Kaludercic on peregrine
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Wed, 05 Jun 2024 12:25:03 GMT)
Full text and
rfc822 format available.
Message #8 received at 71374 <at> debbugs.gnu.org (full text, mbox):
> From: Philip Kaludercic <philipk <at> posteo.net>
> Date: Wed, 05 Jun 2024 06:55:46 +0000
>
> The main issue with this patch is that it drops the syntax highlighting
> in the *string edit* buffer, but we could fix that in a second patch by
> adding support to specify a major mode to inherit from when editing a
> string.
Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong
with the current implementation, right? If so, I'd prefer to wait
with this until after the emacs-30 branch is cut.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Thu, 06 Jun 2024 06:24:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 71374 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Philip Kaludercic <philipk <at> posteo.net>
>> Date: Wed, 05 Jun 2024 06:55:46 +0000
>>
>> The main issue with this patch is that it drops the syntax highlighting
>> in the *string edit* buffer, but we could fix that in a second patch by
>> adding support to specify a major mode to inherit from when editing a
>> string.
>
> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong
> with the current implementation, right? If so, I'd prefer to wait
> with this until after the emacs-30 branch is cut.
Right, it just seemed like the kind of thing where it would be natural
to demonstrate string-edit.
--
Philip Kaludercic on peregrine
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Sun, 30 Jun 2024 05:40:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 71374 <at> debbugs.gnu.org (full text, mbox):
Philip Kaludercic <philipk <at> posteo.net> writes:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Philip Kaludercic <philipk <at> posteo.net>
>>> Date: Wed, 05 Jun 2024 06:55:46 +0000
>>>
>>> The main issue with this patch is that it drops the syntax highlighting
>>> in the *string edit* buffer, but we could fix that in a second patch by
>>> adding support to specify a major mode to inherit from when editing a
>>> string.
>>
>> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong
>> with the current implementation, right? If so, I'd prefer to wait
>> with this until after the emacs-30 branch is cut.
>
> Right, it just seemed like the kind of thing where it would be natural
> to demonstrate string-edit.
Feel free to install on master now, thanks.
Severity set to 'wishlist' from 'normal'
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 30 Jun 2024 05:40:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Sat, 13 Jul 2024 21:55:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 71374 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefankangas <at> gmail.com> writes:
> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>>>> From: Philip Kaludercic <philipk <at> posteo.net>
>>>> Date: Wed, 05 Jun 2024 06:55:46 +0000
>>>>
>>>> The main issue with this patch is that it drops the syntax highlighting
>>>> in the *string edit* buffer, but we could fix that in a second patch by
>>>> adding support to specify a major mode to inherit from when editing a
>>>> string.
>>>
>>> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong
>>> with the current implementation, right? If so, I'd prefer to wait
>>> with this until after the emacs-30 branch is cut.
>>
>> Right, it just seemed like the kind of thing where it would be natural
>> to demonstrate string-edit.
>
> Feel free to install on master now, thanks.
Philip, has this been installed on master? Can the bug be closed?
Reply sent
to
Philip Kaludercic <philipk <at> posteo.net>
:
You have taken responsibility.
(Sun, 28 Jul 2024 12:05:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Philip Kaludercic <philipk <at> posteo.net>
:
bug acknowledged by developer.
(Sun, 28 Jul 2024 12:05:02 GMT)
Full text and
rfc822 format available.
Message #24 received at 71374-done <at> debbugs.gnu.org (full text, mbox):
Jeremy Bryant <jb <at> jeremybryant.net> writes:
> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> Philip Kaludercic <philipk <at> posteo.net> writes:
>>
>>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>>
>>>>> From: Philip Kaludercic <philipk <at> posteo.net>
>>>>> Date: Wed, 05 Jun 2024 06:55:46 +0000
>>>>>
>>>>> The main issue with this patch is that it drops the syntax highlighting
>>>>> in the *string edit* buffer, but we could fix that in a second patch by
>>>>> adding support to specify a major mode to inherit from when editing a
>>>>> string.
>>>>
>>>> Thanks. This is basically a cleanup, yes? IOW, there's nothing wrong
>>>> with the current implementation, right? If so, I'd prefer to wait
>>>> with this until after the emacs-30 branch is cut.
>>>
>>> Right, it just seemed like the kind of thing where it would be natural
>>> to demonstrate string-edit.
>>
>> Feel free to install on master now, thanks.
>
> Philip, has this been installed on master? Can the bug be closed?
I hadn't pushed the change, have done so now. Closing the report.
Thanks for the reminder.
--
Philip Kaludercic on peregrine
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Fri, 02 Aug 2024 09:05:02 GMT)
Full text and
rfc822 format available.
Message #27 received at 71374 <at> debbugs.gnu.org (full text, mbox):
reopen 71374
quit
Hi Philip,
Philip Kaludercic <philipk <at> posteo.net> writes:
> I hadn't pushed the change, have done so now. Closing the report.
> Thanks for the reminder.
I'm reopening this (hope you don't mind) to keep track of the minor
regressions I mentioned here:
https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html
Thanks,
Eshel
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 02 Aug 2024 09:05:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Mon, 12 Aug 2024 11:53:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 71374 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eshel Yaron <me <at> eshelyaron.com> writes:
> reopen 71374
> quit
>
> Hi Philip,
>
> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> I hadn't pushed the change, have done so now. Closing the report.
>> Thanks for the reminder.
>
> I'm reopening this (hope you don't mind) to keep track of the minor
> regressions I mentioned here:
>
> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html
Thanks, and my apologies for the late reply.
The issue seems to be that (thing-at-point 'sexp) returns nil if inside
a s-expression looking at whitespace:
(1 2 3 4 5)
^
M-: (thing-at-point 'sexp) ;=> nil
One idea is to fall back on a defun at point, if no sexp is found:
[Message part 2 (text/plain, inline)]
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 8ea5b301684..4d55ea8bbff 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1507,13 +1507,14 @@ help-fns-edit-variable
"Edit the variable under point."
(declare (completion ignore))
(interactive)
- (let* ((val (thing-at-point 'sexp))
- (var (get-text-property 0 'help-fns--edit-variable val)))
+ (let ((val (or (thing-at-point 'sexp)
+ (thing-at-point 'defun))))
(unless val
- (error "No variable under point"))
- (let ((str (read-string-from-buffer
- (format ";; Edit the `%s' variable." (nth 0 var))
- (prin1-to-string (nth 1 var)))))
+ (error "No value at point"))
+ (let* ((var (get-text-property 0 'help-fns--edit-variable val))
+ (str (read-string-from-buffer
+ (format ";; Edit the `%s' variable." (nth 0 var))
+ (prin1-to-string (nth 1 var)))))
(set (nth 0 var) (read str)))))
(defun help-fns--run-describe-functions (functions &rest args)
[Message part 3 (text/plain, inline)]
Additionally, I moved the `get-text-property' after the check, to ensure
that the indented error message is used.
Comments?
>
> Thanks,
>
> Eshel
--
Philip Kaludercic on peregrine
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Tue, 13 Aug 2024 06:00:03 GMT)
Full text and
rfc822 format available.
Message #35 received at 71374 <at> debbugs.gnu.org (full text, mbox):
Philip Kaludercic <philipk <at> posteo.net> writes:
> Eshel Yaron <me <at> eshelyaron.com> writes:
>
>> I'm reopening this (hope you don't mind) to keep track of the minor
>> regressions I mentioned here:
>>
>> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html
>
> Thanks, and my apologies for the late reply.
No problem at all.
> The issue seems to be that (thing-at-point 'sexp) returns nil if inside
> a s-expression looking at whitespace:
>
> (1 2 3 4 5)
> ^
> M-: (thing-at-point 'sexp) ;=> nil
>
> One idea is to fall back on a defun at point, if no sexp is found:
>
> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> index 8ea5b301684..4d55ea8bbff 100644
> --- a/lisp/help-fns.el
> +++ b/lisp/help-fns.el
> @@ -1507,13 +1507,14 @@ help-fns-edit-variable
> "Edit the variable under point."
> (declare (completion ignore))
> (interactive)
> - (let* ((val (thing-at-point 'sexp))
> - (var (get-text-property 0 'help-fns--edit-variable val)))
> + (let ((val (or (thing-at-point 'sexp)
> + (thing-at-point 'defun))))
> (unless val
> - (error "No variable under point"))
> - (let ((str (read-string-from-buffer
> - (format ";; Edit the `%s' variable." (nth 0 var))
> - (prin1-to-string (nth 1 var)))))
> + (error "No value at point"))
> + (let* ((var (get-text-property 0 'help-fns--edit-variable val))
> + (str (read-string-from-buffer
> + (format ";; Edit the `%s' variable." (nth 0 var))
> + (prin1-to-string (nth 1 var)))))
> (set (nth 0 var) (read str)))))
Maybe I'm missing something, but why are val and the thing-at-point call
needed at all? Simply grabbing the help-fns--edit-variable property at
point should be work as well, I think.
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71374
; Package
emacs
.
(Mon, 26 Aug 2024 20:29:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 71374 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eshel Yaron <me <at> eshelyaron.com> writes:
> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> Eshel Yaron <me <at> eshelyaron.com> writes:
>>
>>> I'm reopening this (hope you don't mind) to keep track of the minor
>>> regressions I mentioned here:
>>>
>>> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html
>>
>> Thanks, and my apologies for the late reply.
>
> No problem at all.
>
>> The issue seems to be that (thing-at-point 'sexp) returns nil if inside
>> a s-expression looking at whitespace:
>>
>> (1 2 3 4 5)
>> ^
>> M-: (thing-at-point 'sexp) ;=> nil
>>
>> One idea is to fall back on a defun at point, if no sexp is found:
>>
>> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
>> index 8ea5b301684..4d55ea8bbff 100644
>> --- a/lisp/help-fns.el
>> +++ b/lisp/help-fns.el
>> @@ -1507,13 +1507,14 @@ help-fns-edit-variable
>> "Edit the variable under point."
>> (declare (completion ignore))
>> (interactive)
>> - (let* ((val (thing-at-point 'sexp))
>> - (var (get-text-property 0 'help-fns--edit-variable val)))
>> + (let ((val (or (thing-at-point 'sexp)
>> + (thing-at-point 'defun))))
>> (unless val
>> - (error "No variable under point"))
>> - (let ((str (read-string-from-buffer
>> - (format ";; Edit the `%s' variable." (nth 0 var))
>> - (prin1-to-string (nth 1 var)))))
>> + (error "No value at point"))
>> + (let* ((var (get-text-property 0 'help-fns--edit-variable val))
>> + (str (read-string-from-buffer
>> + (format ";; Edit the `%s' variable." (nth 0 var))
>> + (prin1-to-string (nth 1 var)))))
>> (set (nth 0 var) (read str)))))
>
> Maybe I'm missing something, but why are val and the thing-at-point call
> needed at all? Simply grabbing the help-fns--edit-variable property at
> point should be work as well, I think.
No, I think you are right, we don't have to take the detour over
'thing-at-point', meaning that if I am not mistaken, the fix should
reduce itself to:
[Message part 2 (text/plain, inline)]
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 8a2ae79736f..97d054ce6db 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1507,9 +1507,8 @@ help-fns-edit-variable
"Edit the variable under point."
(declare (completion ignore))
(interactive)
- (let* ((val (thing-at-point 'sexp))
- (var (get-text-property 0 'help-fns--edit-variable val)))
- (unless val
+ (let ((var (get-text-property (point) 'help-fns--edit-variable)))
+ (unless var
(error "No variable under point"))
(let ((str (read-string-from-buffer
(format ";; Edit the `%s' variable." (nth 0 var))
[Message part 3 (text/plain, inline)]
> Eshel
--
Philip Kaludercic on peregrine
Reply sent
to
Philip Kaludercic <philipk <at> posteo.net>
:
You have taken responsibility.
(Mon, 02 Sep 2024 20:58:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Philip Kaludercic <philipk <at> posteo.net>
:
bug acknowledged by developer.
(Mon, 02 Sep 2024 20:58:02 GMT)
Full text and
rfc822 format available.
Message #43 received at 71374-done <at> debbugs.gnu.org (full text, mbox):
Philip Kaludercic <philipk <at> posteo.net> writes:
> Eshel Yaron <me <at> eshelyaron.com> writes:
>
>> Philip Kaludercic <philipk <at> posteo.net> writes:
>>
>>> Eshel Yaron <me <at> eshelyaron.com> writes:
>>>
>>>> I'm reopening this (hope you don't mind) to keep track of the minor
>>>> regressions I mentioned here:
>>>>
>>>> https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01202.html
>>>
>>> Thanks, and my apologies for the late reply.
>>
>> No problem at all.
>>
>>> The issue seems to be that (thing-at-point 'sexp) returns nil if inside
>>> a s-expression looking at whitespace:
>>>
>>> (1 2 3 4 5)
>>> ^
>>> M-: (thing-at-point 'sexp) ;=> nil
>>>
>>> One idea is to fall back on a defun at point, if no sexp is found:
>>>
>>> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
>>> index 8ea5b301684..4d55ea8bbff 100644
>>> --- a/lisp/help-fns.el
>>> +++ b/lisp/help-fns.el
>>> @@ -1507,13 +1507,14 @@ help-fns-edit-variable
>>> "Edit the variable under point."
>>> (declare (completion ignore))
>>> (interactive)
>>> - (let* ((val (thing-at-point 'sexp))
>>> - (var (get-text-property 0 'help-fns--edit-variable val)))
>>> + (let ((val (or (thing-at-point 'sexp)
>>> + (thing-at-point 'defun))))
>>> (unless val
>>> - (error "No variable under point"))
>>> - (let ((str (read-string-from-buffer
>>> - (format ";; Edit the `%s' variable." (nth 0 var))
>>> - (prin1-to-string (nth 1 var)))))
>>> + (error "No value at point"))
>>> + (let* ((var (get-text-property 0 'help-fns--edit-variable val))
>>> + (str (read-string-from-buffer
>>> + (format ";; Edit the `%s' variable." (nth 0 var))
>>> + (prin1-to-string (nth 1 var)))))
>>> (set (nth 0 var) (read str)))))
>>
>> Maybe I'm missing something, but why are val and the thing-at-point call
>> needed at all? Simply grabbing the help-fns--edit-variable property at
>> point should be work as well, I think.
>
> No, I think you are right, we don't have to take the detour over
> 'thing-at-point', meaning that if I am not mistaken, the fix should
> reduce itself to:
>
> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> index 8a2ae79736f..97d054ce6db 100644
> --- a/lisp/help-fns.el
> +++ b/lisp/help-fns.el
> @@ -1507,9 +1507,8 @@ help-fns-edit-variable
> "Edit the variable under point."
> (declare (completion ignore))
> (interactive)
> - (let* ((val (thing-at-point 'sexp))
> - (var (get-text-property 0 'help-fns--edit-variable val)))
> - (unless val
> + (let ((var (get-text-property (point) 'help-fns--edit-variable)))
> + (unless var
> (error "No variable under point"))
> (let ((str (read-string-from-buffer
> (format ";; Edit the `%s' variable." (nth 0 var))
I have pushed this change and am closing the report.
>> Eshel
--
Philip Kaludercic on peregrine
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 02 Oct 2024 11:24:19 GMT)
Full text and
rfc822 format available.
This bug report was last modified 262 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.