emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs 5b88ec259c 026/120: Change from symbol-at-point to t


From: João Távora
Subject: feature/eglot2emacs 5b88ec259c 026/120: Change from symbol-at-point to thing-at-point
Date: Thu, 20 Oct 2022 07:16:46 -0400 (EDT)

branch: feature/eglot2emacs
commit 5b88ec259ccf24b87a7c8c3d35173a2353dd8517
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Change from symbol-at-point to thing-at-point
    
    * eglot.el (eglot-rename): Change from symbol-at-point to
    thing-at-point to avoid interning a symbol.  Add "unknown symbol" to
    prompt when no symbol is found.
    
    Co-authored-by: João Távora <joaotavora@gmail.com>
    GitHub-reference: close https://github.com/joaotavora/eglot/issues/385
---
 lisp/progmodes/eglot.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index dc20ef751b..4e92bf09bf 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2774,9 +2774,11 @@ is not active."
 (defun eglot-rename (newname)
   "Rename the current symbol to NEWNAME."
   (interactive
-   (list (read-from-minibuffer (format "Rename `%s' to: " (symbol-at-point))
-                               nil nil nil nil
-                               (symbol-name (symbol-at-point)))))
+   (list (read-from-minibuffer
+          (format "Rename `%s' to: " (or (thing-at-point 'symbol t)
+                                         "unknown symbol"))
+          nil nil nil nil
+          (symbol-name (symbol-at-point)))))
   (unless (eglot--server-capable :renameProvider)
     (eglot--error "Server can't rename!"))
   (eglot--apply-workspace-edit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]