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

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

[nongnu] elpa/drupal-mode bdf3709e10 253/308: Fix bug in drupal/etags-ge


From: ELPA Syncer
Subject: [nongnu] elpa/drupal-mode bdf3709e10 253/308: Fix bug in drupal/etags-get-function-args
Date: Tue, 25 Jan 2022 10:59:52 -0500 (EST)

branch: elpa/drupal-mode
commit bdf3709e105d0c97e4b516f52d96c9eb70b665de
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>

    Fix bug in drupal/etags-get-function-args
    
    With eldoc enabled, this function could move point unexpectedly to the
    end of line when point was on the *definition* of anything listed in the
    TAGS file.  (This is due to the `find-tag-noselect`, which can return the
    already-open buffer for a given tag's file, if one exists).
    
    Adding a `save-excursion` around the `with-current-buffer` fixes this bug.
---
 drupal/etags.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drupal/etags.el b/drupal/etags.el
index 6c23a7e216..d502b4596c 100644
--- a/drupal/etags.el
+++ b/drupal/etags.el
@@ -47,12 +47,13 @@
   "Get function arguments from etags TAGS."
   (when (and (boundp 'drupal/etags-rootdir)
              (file-exists-p (concat drupal/etags-rootdir "TAGS")))
-    (with-current-buffer (find-tag-noselect symbol nil nil)
-      (goto-char (point-min))
-      (when (re-search-forward
-             (format "function\\s-+%s\\s-*(\\([^{]*\\))" symbol)
-             nil t)
-        (match-string-no-properties 1)))))
+    (save-excursion
+     (with-current-buffer (find-tag-noselect symbol nil nil)
+       (goto-char (point-min))
+       (when (re-search-forward
+              (format "function\\s-+%s\\s-*(\\([^{]*\\))" symbol)
+              nil t)
+         (match-string-no-properties 1))))))
 
 (add-hook 'drupal-mode-hook #'drupal/etags-enable)
 



reply via email to

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