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

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

[nongnu] elpa/go-mode c849d72 273/495: Don't throw errors in some go-got


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode c849d72 273/495: Don't throw errors in some go-goto-* functions
Date: Sat, 7 Aug 2021 09:05:30 -0400 (EDT)

branch: elpa/go-mode
commit c849d7299141a947e91067874b5c9f699fb232b7
Author: Lowe Thiderman <lowe.thiderman@gmail.com>
Commit: Dominik Honnef <dominik@honnef.co>

    Don't throw errors in some go-goto-* functions
    
    By default, don't throw errors in go-goto-method-receiver and
    go-goto-docstring when called interactively on anonymous functions.
    Instead, assume that the user meant to run it on the surrounding named
    function.
    
    If they are called non-interactively with a prefix argument, we should
    not throw an error about not being able to run on anonymous functions
    either since we have explicitly asked to ignore them with the prefix
    argument.
---
 go-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/go-mode.el b/go-mode.el
index 4aee729..b4cf1fa 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1718,6 +1718,7 @@ an error is raised."
   (interactive "P")
 
   (when (and (not (called-interactively-p 'interactive))
+             (not arg)
              (go--in-anonymous-funcion-p))
     (error "Anonymous functions cannot have method receivers"))
 
@@ -1739,6 +1740,7 @@ an error is raised."
   (interactive "P")
 
   (when (and (not (called-interactively-p 'interactive))
+             (not arg)
              (go--in-anonymous-funcion-p))
     (error "Anonymous functions do not have docstrings"))
 



reply via email to

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