From: Dmitry Gutov <dgutov@yandex.ru>
To: Peter Povinec <spepo.42@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: 55016@debbugs.gnu.org
Subject: bug#55016: 28.1; xref-find-references finds no matches if project dir contains a space
Date: Tue, 26 Apr 2022 05:07:43 +0300 [thread overview]
Message-ID: <46536fae-4122-6994-99d0-d5f79af22aba@yandex.ru> (raw)
In-Reply-To: <CAJDw7KseZso8PN_L3bf4vW-Dc8WbpMVfT7xQmXYa7Uy432xOJA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
On 26.04.2022 04:05, Peter Povinec wrote:
> Is it just me, or does it fail for you too?
> What is the best way to apply such a patch to my local sources?
I haven't tried, but 'C-c C-a' in diff-mode usually helps with this kind
of issues. So you save the patch from the email into a file with
extension .diff, visit in in Emacs, and then press the above key sequence.
Anyway, here's the patch in attachment which should be much easier to
apply either way. It also contains a tiny renaming.
[-- Attachment #2: semantic-symref-grep--local-dir.diff --]
[-- Type: text/x-patch, Size: 1995 bytes --]
diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el
index 27ea80fc32..076775bfec 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -139,6 +139,8 @@ semantic-symref-grep--quote-grep
(lambda (s) (concat "\\" s))
string nil t))
+(defvar semantic-symref-grep--local-dir nil)
+
(cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep))
"Perform a search with Grep."
;; Grep doesn't support some types of searches.
@@ -170,11 +172,12 @@ semantic-symref-perform-search
(erase-buffer)
(setq default-directory rootdir)
(let ((cmd (semantic-symref-grep-use-template
- (directory-file-name (file-local-name rootdir))
+ "."
filepattern grepflags greppat)))
(process-file semantic-symref-grep-shell nil b nil
shell-command-switch cmd)))
- (setq ans (semantic-symref-parse-tool-output tool b))
+ (let ((semantic-symref-grep--local-dir (directory-file-name (file-local-name rootdir))))
+ (setq ans (semantic-symref-parse-tool-output tool b)))
;; Return the answer
ans))
@@ -190,12 +193,12 @@ semantic-symref-parse-tool-output-one-line
((eq (oref tool resulttype) 'line-and-text)
(when (re-search-forward grep-re nil t)
(list (string-to-number (match-string line-group))
- (match-string file-group)
+ (concat semantic-symref-grep--local-dir (substring (match-string file-group) 1))
(buffer-substring-no-properties (point) (line-end-position)))))
(t
(when (re-search-forward grep-re nil t)
(cons (string-to-number (match-string line-group))
- (match-string file-group))
+ (concat semantic-symref-grep--local-dir (substring (match-string file-group) 1)))
)))))
(provide 'semantic/symref/grep)
next prev parent reply other threads:[~2022-04-26 2:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 4:52 bug#55016: 28.1; xref-find-references finds no matches if project dir contains a space Peter Povinec
2022-04-19 7:13 ` Eli Zaretskii
2022-04-19 17:06 ` Peter Povinec
2022-04-19 17:32 ` Eli Zaretskii
2022-04-19 17:36 ` Eli Zaretskii
2022-04-19 17:57 ` Peter Povinec
2022-04-19 18:17 ` Eli Zaretskii
2022-04-19 18:24 ` Eli Zaretskii
2022-04-24 2:00 ` Dmitry Gutov
2022-04-24 5:31 ` Eli Zaretskii
2022-04-25 2:08 ` Dmitry Gutov
2022-04-25 11:48 ` Eli Zaretskii
2022-04-26 2:05 ` Dmitry Gutov
2022-04-26 12:00 ` Eli Zaretskii
2022-04-26 12:28 ` Dmitry Gutov
2022-04-26 12:36 ` Eli Zaretskii
2022-04-27 1:57 ` Dmitry Gutov
2022-04-27 13:53 ` Eli Zaretskii
2022-04-26 1:05 ` Peter Povinec
2022-04-26 2:07 ` Dmitry Gutov [this message]
2022-04-26 4:57 ` Peter Povinec
2022-04-26 11:18 ` Eli Zaretskii
2022-04-26 12:30 ` Dmitry Gutov
2022-04-27 3:00 ` Peter Povinec
2022-10-31 1:00 ` Dmitry Gutov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46536fae-4122-6994-99d0-d5f79af22aba@yandex.ru \
--to=dgutov@yandex.ru \
--cc=55016@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=spepo.42@gmail.com \
/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 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).