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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Chmouel Boudjnah <chmouel <at> chmouel.com>
Subject: bug#69426: closed (Re: bug#69426: 29.2; Let eglot-rename suggest
 thing-at-point when renaming)
Date: Tue, 27 Feb 2024 16:01:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#69426: 29.2; Let eglot-rename suggest thing-at-point when renaming

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 69426 <at> debbugs.gnu.org.

-- 
69426: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69426
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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.

[Message part 3 (message/rfc822, inline)]
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.



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

Previous Next


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