From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
To: emacs-devel@gnu.org
Subject: [PATCH v2] lisp/progmodes/etags.el improve match by string trimming
Date: Sat, 16 Mar 2019 05:13:33 +0300 [thread overview]
Message-ID: <20190316021333.8552-1-Hi-Angel@yandex.ru> (raw)
In-Reply-To: <20190316015314.2335-3-Hi-Angel@yandex.ru>
Not only this improves general usability, but also works around existing
bug in anjuta-tags¹
1: https://gitlab.gnome.org/GNOME/anjuta/issues/8
---
Sorry, I didn't test the last change on (looking-at pat) removal, it
still does matching. Fixed here.
lisp/progmodes/etags.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 62637414ef8..0e0e649a5d5 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1363,9 +1363,10 @@ etags-goto-tag-location
;; since just going around the loop once probably
;; costs about as much as searching 2000 chars.
(setq offset 1000
- pat (concat (if (eq selective-display t)
- "\\(^\\|\^m\\)" "^")
- (regexp-quote (car tag-info))))
+ ;; Improve the match by trimming the pattern. It's
+ ;; impossible anyway that 2 tags would only differ by
+ ;; trailing whitespace.
+ pat (string-trim (regexp-quote (car tag-info))))
;; The character position in the tags table is 0-origin and counts CRs.
;; Convert it to a 1-origin Emacs character position.
(when startpos
--
2.21.0
next prev parent reply other threads:[~2019-03-16 2:13 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Konstantin Kharlamov [this message]
2019-03-16 12:46 ` [PATCH v2] " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190316021333.8552-1-Hi-Angel@yandex.ru \
--to=hi-angel@yandex.ru \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.