From: Theodor Thornhill Date: Mon, 30 Dec 2019 15:26:22 +0000 (+0100) Subject: Change from symbol-at-point to thing-at-point X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~92 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b88ec259ccf24b87a7c8c3d35173a2353dd8517;p=emacs.git 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 GitHub-reference: close https://github.com/joaotavora/eglot/issues/385 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index dc20ef751b8..4e92bf09bf2 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