GNU bug report logs - #55016
28.1; xref-find-references finds no matches if project dir contains a space

Previous Next

Package: emacs;

Reported by: Peter Povinec <spepo.42 <at> gmail.com>

Date: Tue, 19 Apr 2022 04:59:02 UTC

Severity: normal

Found in version 28.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 55016 <at> debbugs.gnu.org, spepo.42 <at> gmail.com
Subject: bug#55016: 28.1; xref-find-references finds no matches if project dir contains a space
Date: Tue, 19 Apr 2022 21:24:18 +0300
> Date: Tue, 19 Apr 2022 21:17:03 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 55016 <at> debbugs.gnu.org
> 
> > > Actually, one more idea: perhaps the quoting makes things first
> > > because your file names begin with "~/"?  In that case, doing
> > > something like this instead should do better:
> > >
> > >    (shell-quote-argument (expand-file-name rootdir))
> > 
> > That works! Both 'space dir' and 'nospace' dir cases work the same way now.
> 
> OK, thanks.  Now I understand what's going on, and can work on a real
> fix for Emacs 29.

Dmitry, there's something here I don't understand.  In
semantic-symref-perform-search method that uses find/grep, we do this:

    (with-current-buffer b
      (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)))

Since we bind default-directory to ROOTDIR, why do we also need to
pass ROOTDIR to semantic-symref-grep-use-template?  Why not use ".",
or even nil (which gets expanded to "." AFAIU)?  Then this entire
issue with embedded blanks in ROOTDIR would not have happened, because
the problematic directory name would not be exposed to the shell.

What am I missing here?




This bug report was last modified 2 years and 263 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.