GNU bug report logs - #69426
29.2; Let eglot-rename suggest thing-at-point when renaming

Previous Next

Package: emacs;

Reported by: Chmouel Boudjnah <chmouel <at> chmouel.com>

Date: Tue, 27 Feb 2024 13:18:02 UTC

Severity: normal

Found in version 29.2

Done: Eli Zaretskii <eliz <at> gnu.org>

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 69426 in the body.
You can then email your comments to 69426 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69426; Package emacs. (Tue, 27 Feb 2024 13:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chmouel Boudjnah <chmouel <at> chmouel.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 27 Feb 2024 13:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Chmouel Boudjnah <chmouel <at> chmouel.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.2; Let eglot-rename suggest thing-at-point when renaming
Date: Tue, 27 Feb 2024 13:59:26 +0100
When using eglot-rename it asks for a new name (for the variable for
example) to rename to, it would be nice if there was a way to have the
current thing-at-point suggested as the new name.

Usually when renaming a variable you want to rename it to something that
is related to the current name with the defautl behavior you have to
type the current name manually.

I have a function like this that does it:

  (defun my-eglot-rename (newname)
    "Rename the current symbol to NEWNAME with initial input a."
    (interactive
     (list (read-from-minibuffer
            (format "Rename`%s' to: " (or (thing-at-point 'symbol t)
                                          "unknown symbol"))
            (or (thing-at-point 'symbol t) "") nil nil nil
            (symbol-name (symbol-at-point)))))
    (eglot--server-capable-or-lose :renameProvider)
    (eglot--apply-workspace-edit
     (jsonrpc-request (eglot--current-server-or-lose)
                      :textDocument/rename
`(,@(eglot--TextDocumentPositionParams)
                                             :newName ,newname))


which probably can work as advice to eglot-rename but it would be nice
if we can have this builtin.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69426; Package emacs. (Tue, 27 Feb 2024 13:35:01 GMT) Full text and rfc822 format available.

Message #8 received at 69426 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chmouel Boudjnah <chmouel <at> chmouel.com>
Cc: 69426 <at> debbugs.gnu.org
Subject: Re: bug#69426: 29.2;
 Let eglot-rename suggest thing-at-point when renaming
Date: Tue, 27 Feb 2024 15:33:33 +0200
> From: Chmouel Boudjnah <chmouel <at> chmouel.com>
> Date: Tue, 27 Feb 2024 13:59:26 +0100
> 
> When using eglot-rename it asks for a new name (for the variable for
> example) to rename to, it would be nice if there was a way to have the
> current thing-at-point suggested as the new name.
> 
> Usually when renaming a variable you want to rename it to something that
> is related to the current name with the defautl behavior you have to
> type the current name manually.

You don't need to type the current name manually, you can instead
press <DOWN> arrow or M-n, and Emacs will "type" the current name for
you.  So after that you only need to edit the current name to the new
name.  Isn't that what you wanted?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69426; Package emacs. (Tue, 27 Feb 2024 13:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 69426 <at> debbugs.gnu.org (full text, mbox):

From: Chmouel Boudjnah <chmouel <at> chmouel.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69426 <at> debbugs.gnu.org
Subject: Re: bug#69426: 29.2;
 Let eglot-rename suggest thing-at-point when renaming
Date: Tue, 27 Feb 2024 14:37:01 +0100
On Tue, Feb 27, 2024 at 2:33 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> You don't need to type the current name manually, you can instead
> press <DOWN> arrow or M-n, and Emacs will "type" the current name for
> you.  So after that you only need to edit the current name to the new
> name.  Isn't that what you wanted?

Yes that's correct, I forgot this was something minibuffer via
next-history-element offers across emacs, thank you!

Chmouel,




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69426; Package emacs. (Tue, 27 Feb 2024 13:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 69426 <at> debbugs.gnu.org (full text, mbox):

From: Eshel Yaron <me <at> eshelyaron.com>
To: Chmouel Boudjnah <chmouel <at> chmouel.com>
Cc: 69426 <at> debbugs.gnu.org
Subject: Re: bug#69426: 29.2; Let eglot-rename suggest thing-at-point when
 renaming
Date: Tue, 27 Feb 2024 14:29:32 +0100
Hello Chmouel,

Chmouel Boudjnah <chmouel <at> chmouel.com> writes:

> When using eglot-rename it asks for a new name (for the variable for
> example) to rename to, it would be nice if there was a way to have the
> current thing-at-point suggested as the new name.

AFAICT, that is more or less already the case: eglot-rename uses the
name of the symbol at point as the minibuffer default value.

> Usually when renaming a variable you want to rename it to something that
> is related to the current name with the defautl behavior you have to
> type the current name manually.

Just hit M-n and it's there :)


Best,

Eshel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69426; Package emacs. (Tue, 27 Feb 2024 14:11:03 GMT) Full text and rfc822 format available.

Message #17 received at 69426 <at> debbugs.gnu.org (full text, mbox):

From: Chmouel Boudjnah <chmouel <at> chmouel.com>
To: Eshel Yaron <me <at> eshelyaron.com>
Cc: 69426 <at> debbugs.gnu.org
Subject: Re: bug#69426: 29.2;
 Let eglot-rename suggest thing-at-point when renaming
Date: Tue, 27 Feb 2024 14:32:25 +0100
On Tue, Feb 27, 2024 at 2:29 PM Eshel Yaron <me <at> eshelyaron.com> wrote:

> > Usually when renaming a variable you want to rename it to something that
> > is related to the current name with the defautl behavior you have to
> > type the current name manually.
>
> Just hit M-n and it's there :)

Thanks Eshel, I always forget about that one! I guess we can close this then!

Cheers,
Chmouel




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 27 Feb 2024 16:01:02 GMT) Full text and rfc822 format available.

Notification sent to Chmouel Boudjnah <chmouel <at> chmouel.com>:
bug acknowledged by developer. (Tue, 27 Feb 2024 16:01:03 GMT) Full text and rfc822 format available.

Message #22 received at 69426-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chmouel Boudjnah <chmouel <at> chmouel.com>
Cc: me <at> eshelyaron.com, 69426-done <at> debbugs.gnu.org
Subject: Re: bug#69426: 29.2;
 Let eglot-rename suggest thing-at-point when renaming
Date: Tue, 27 Feb 2024 17:59:38 +0200
> Cc: 69426 <at> debbugs.gnu.org
> From: Chmouel Boudjnah <chmouel <at> chmouel.com>
> Date: Tue, 27 Feb 2024 14:32:25 +0100
> 
> On Tue, Feb 27, 2024 at 2:29 PM Eshel Yaron <me <at> eshelyaron.com> wrote:
> 
> > > Usually when renaming a variable you want to rename it to something that
> > > is related to the current name with the defautl behavior you have to
> > > type the current name manually.
> >
> > Just hit M-n and it's there :)
> 
> Thanks Eshel, I always forget about that one! I guess we can close this then!

Done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 27 Mar 2024 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.