unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/3] lisp/progmodes/etags.el clean up code by removing a temporary
@ 2019-03-16  1:53 Konstantin Kharlamov
  2019-03-16  1:53 ` [PATCH 2/3] lisp/progmodes/etags.el don't (forward-char) as it's overriden next line Konstantin Kharlamov
                   ` (2 more replies)
  0 siblings, 3 replies; 45+ messages in thread
From: Konstantin Kharlamov @ 2019-03-16  1:53 UTC (permalink / raw)
  To: emacs-devel

---
 lisp/progmodes/etags.el | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index c2715be5370..05dc7aa1baf 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1351,7 +1351,7 @@ etags-goto-tag-location
 hits the start of file."
   (let ((startpos (cdr (cdr tag-info)))
 	(line (car (cdr tag-info)))
-	offset found pat)
+	offset pat)
     (if (eq (car tag-info) t)
 	;; Direct file tag.
 	(cond (line (progn (goto-char (point-min))
@@ -1363,7 +1363,6 @@ etags-goto-tag-location
       ;; since just going around the loop once probably
       ;; costs about as much as searching 2000 chars.
       (setq offset 1000
-	    found nil
 	    pat (concat (if (eq selective-display t)
 			    "\\(^\\|\^m\\)" "^")
 			(regexp-quote (car tag-info))))
@@ -1385,19 +1384,16 @@ etags-goto-tag-location
 				    (point)))))
       (or startpos
 	  (setq startpos (point-min)))
-      ;; First see if the tag is right at the specified location.
+
       (goto-char startpos)
-      (setq found (looking-at pat))
-      (while (and (not found)
-		  (progn
-		    (goto-char (- startpos offset))
-		    (not (bobp))))
-	(setq found
-	      (re-search-forward pat (+ startpos offset) t)
-	      offset (* 3 offset)))	; expand search window
-      (or found
-	  (re-search-forward pat nil t)
-	  (user-error "Rerun etags: `%s' not found in %s"
+      (or (looking-at pat) ; Is tag at the specified location?
+          (while (progn
+                   (goto-char (- startpos offset))
+                   (and (not (bobp))
+                        (not (re-search-forward pat (+ startpos offset) t))))
+            (setq offset (* 3 offset))) ; expand search window
+          (re-search-forward pat nil t)
+          (user-error "Rerun etags: `%s' not found in %s"
                       pat buffer-file-name)))
     ;; Position point at the right place
     ;; if the search string matched an extra Ctrl-m at the beginning.
-- 
2.21.0




^ permalink raw reply related	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2019-03-19  6:55 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-16  1:53 [PATCH 1/3] lisp/progmodes/etags.el clean up code by removing a temporary Konstantin Kharlamov
2019-03-16  1:53 ` [PATCH 2/3] lisp/progmodes/etags.el don't (forward-char) as it's overriden next line Konstantin Kharlamov
2019-03-16 12:43   ` Eli Zaretskii
2019-03-16 15:42     ` Konstantin Kharlamov
2019-03-16 16:00       ` Stefan Monnier
2019-03-16 16:26       ` Eli Zaretskii
2019-03-16 21:12         ` Konstantin Kharlamov
2019-03-16 21:47           ` Konstantin Kharlamov
2019-03-17  3:36           ` Eli Zaretskii
2019-03-17  3:41             ` Konstantin Kharlamov
2019-03-17 15:17               ` Eli Zaretskii
2019-03-17 15:52                 ` Stefan Monnier
2019-03-17 16:13                   ` Eli Zaretskii
2019-03-17 17:36                     ` Stefan Monnier
2019-03-17 21:14                       ` Eradicating selective-display == t (was: [PATCH 2/3] lisp/progmodes/etags.el don't (forward-char) as it's overriden next line) Stefan Monnier
2019-03-17 21:32                         ` Konstantin Kharlamov
2019-03-18  1:12                           ` Eradicating selective-display == t Stefan Monnier
2019-03-18  9:16                             ` Konstantin Kharlamov
2019-03-18 12:10                               ` Stefan Monnier
2019-03-17 19:06                 ` [PATCH 2/3] lisp/progmodes/etags.el don't (forward-char) as it's overriden next line Konstantin Kharlamov
2019-03-17 19:22                   ` Eli Zaretskii
2019-03-17 19:29                     ` Konstantin Kharlamov
2019-03-17 20:21                       ` Eli Zaretskii
2019-03-17 20:27                         ` Konstantin Kharlamov
2019-03-17 20:40                           ` Eli Zaretskii
2019-03-17 20:44                             ` Konstantin Kharlamov
2019-03-18  3:34                               ` Eli Zaretskii
2019-03-18  9:43                                 ` Konstantin Kharlamov
2019-03-18  9:57                                   ` Konstantin Kharlamov
2019-03-18 17:00                                   ` Eli Zaretskii
2019-03-18 19:15                                     ` Konstantin Kharlamov
2019-03-18 19:25                                       ` Konstantin Kharlamov
2019-03-18 20:16                                       ` Eli Zaretskii
2019-03-18 21:45                                         ` Konstantin Kharlamov
2019-03-18 23:13                                           ` Konstantin Kharlamov
2019-03-18 23:38                                             ` Konstantin Kharlamov
2019-03-19  1:46                                               ` Stefan Monnier
2019-03-19  6:47                                           ` Eli Zaretskii
2019-03-16  1:53 ` [PATCH 3/3] lisp/progmodes/etags.el improve match by string trimming Konstantin Kharlamov
2019-03-16  2:13   ` [PATCH v2] " Konstantin Kharlamov
2019-03-16 12:46     ` Eli Zaretskii
2019-03-16 15:38       ` Konstantin Kharlamov
2019-03-16 16:29         ` Eli Zaretskii
2019-03-17  2:38     ` [PATCH v3] " Konstantin Kharlamov
2019-03-19  6:55 ` [PATCH v2] lisp/progmodes/etags.el clean up code by removing a temporary Konstantin Kharlamov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).