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

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

[nongnu] elpa/go-mode d964767 399/495: Use forward-word-strictly when av


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode d964767 399/495: Use forward-word-strictly when available
Date: Sat, 7 Aug 2021 09:05:56 -0400 (EDT)

branch: elpa/go-mode
commit d9647672717bb5d507de42975a337c738a0461a3
Author: nverno <noah.v.peart@gmail.com>
Commit: Dominik Honnef <dominik@honnef.co>

    Use forward-word-strictly when available
    
    Closes: gh-167 [via git-merge-pr]
---
 go-mode.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index 8f45651..d86d6c2 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -22,6 +22,12 @@
 (require 'url)
 
 
+(eval-when-compile
+  (defmacro go--forward-word (&optional arg)
+   (if (fboundp 'forward-word-strictly)
+       `(forward-word-strictly ,arg)
+     `(forward-word ,arg))))
+
 (defun go--delete-whole-line (&optional arg)
   "Delete the current line without putting it in the `kill-ring'.
 Derived from function `kill-whole-line'.  ARG is defined as for that
@@ -1675,7 +1681,7 @@ If ARG is non-nil, anonymous functions are ignored."
       ;; should search forward instead.
       (when (not (looking-at "\\<func\\>"))
         (re-search-forward "\\<func\\>" nil t)
-        (forward-word -1))
+        (go--forward-word -1))
 
       ;; If we have landed at an anonymous function, it is possible that we
       ;; were not inside it but below it. If we were not inside it, we should
@@ -1741,7 +1747,7 @@ If ARG is non-nil, anonymous functions are skipped."
       (when (looking-at "\\<func (")
         (setq words 3
               chars 2))
-      (forward-word words)
+      (go--forward-word words)
       (forward-char chars)
       (when (looking-at "Test")
         (forward-char 4)))))
@@ -1752,7 +1758,7 @@ If ARG is non-nil, anonymous functions are skipped."
 If ARG is non-nil, anonymous functions are skipped."
   (interactive "P")
   (go-goto-function-name arg)
-  (forward-word 1)
+  (go--forward-word 1)
   (forward-char 1))
 
 (defun go--goto-return-values (&optional arg)



reply via email to

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