]> git.eshelyaron.com Git - emacs.git/commitdiff
Change from symbol-at-point to thing-at-point
authorTheodor Thornhill <theo@thornhill.no>
Mon, 30 Dec 2019 15:26:22 +0000 (16:26 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Thu, 13 Jan 2022 21:40:23 +0000 (22:40 +0100)
* 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

index dc20ef751b86d00f9da84e313f59789b5e4a0d0b..4e92bf09bf2d4eec8019caabe35b54432ca41f84 100644 (file)
@@ -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