emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/go-mode 498452d 244/495: Don't set old buffer as active af


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 498452d 244/495: Don't set old buffer as active after godef--find-file-line-column
Date: Sat, 7 Aug 2021 09:05:24 -0400 (EDT)

branch: elpa/go-mode
commit 498452d560c07e308e493b7ea7467880dfe56987
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>

    Don't set old buffer as active after godef--find-file-line-column
    
    godef--find-file-line-column uses find-file to open and switch to a
    file, which means the new buffer becomes the current buffer.
    Nevertheless, we wrapped it in with-current-buffer, which
    would (erroneously) reset the current buffer to the previous one. Only
    after all surrounding functions return would current-buffer be correct
    again.
    
    This behaviour was confusing and served no purpose, so stop doing it.
    
    Closes gh-85
---
 go-mode.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index 2fc8f49..1615d5c 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1354,12 +1354,12 @@ visit FILENAME and go to line LINE and column COLUMN."
     (let ((filename (match-string 1 specifier))
           (line (string-to-number (match-string 2 specifier)))
           (column (string-to-number (match-string 3 specifier))))
-      (with-current-buffer (funcall (if other-window #'find-file-other-window 
#'find-file) filename)
-        (go--goto-line line)
-        (beginning-of-line)
-        (forward-char (1- column))
-        (if (buffer-modified-p)
-            (message "Buffer is modified, file position might not have been 
correct"))))))
+      (funcall (if other-window #'find-file-other-window #'find-file) filename)
+      (go--goto-line line)
+      (beginning-of-line)
+      (forward-char (1- column))
+      (if (buffer-modified-p)
+          (message "Buffer is modified, file position might not have been 
correct")))))
 
 (defun godef--call (point)
   "Call godef, acquiring definition position and expression



reply via email to

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