GNU bug report logs - #70329
29.3; etags-regen-mode fails in projects that have spaces in their root path elements

Previous Next

Package: emacs;

Reported by: Magiel Bruntink <magiel.bruntink <at> icloud.com>

Date: Thu, 11 Apr 2024 04:54:02 UTC

Severity: normal

Found in version 29.3

Done: Dmitry Gutov <dmitry <at> gutov.dev>

To reply to this bug, email your comments to 70329 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#70329; Package emacs. (Thu, 11 Apr 2024 04:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Magiel Bruntink <magiel.bruntink <at> icloud.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Apr 2024 04:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Magiel Bruntink <magiel.bruntink <at> icloud.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.3; etags-regen-mode fails in projects that have spaces in their
 root path elements
Date: Wed, 10 Apr 2024 21:32:57 +0200
Dear maintainers,

I wanted to try to the new etags-regen-mode and loaded its lisp manually.

There is an issue with how the new mode deals with paths containing spaces,
however.

Running the etags--xref-backend through eg. xref-find-definitions
within a file in a project that has spaces in its path elements,
eg. "c:/temp/test project/test.c" will cause an error.

Messages seen are:
Generating new tags table...
(Shell command failed with code 1 and some error output)
visit-tags-table-buffer: File c:/temp/test project/TAGS does not exist

Error message in the etags-regen-tags-errors* buffer:
c:/temp/test: Permission denied

Thank you,
Magiel Bruntink


------------------------------------------------------------------------------
In GNU Emacs 29.3 (build 2, x86_64-w64-mingw32) of 2024-03-26 built on
 fv-az653-233
Windowing system distributor 'Microsoft Corp.', version 10.0.22631
System Description: Microsoft Windows 10 Home (v10.0.2009.22631.3447)

Configured using:
 'configure --prefix=/ucrt64 --host=x86_64-w64-mingw32
 --build=x86_64-w64-mingw32 --with-modules --without-dbus
 --without-compress-install --with-tree-sitter --with-native-compilation=aot
 'CFLAGS=-march=nocona -msahf -mtune=generic -O2 -pipe -fstack-protector-strong
 -fno-optimize-sibling-calls' CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1 'LDFLAGS=-pipe
 -lpthread''

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LIBXML2 MODULES NATIVE_COMP NOTIFY
W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XPM ZLIB

Important settings:
  value of $LANG: NLD
  locale-coding-system: cp1252

Major mode: Helpful

Minor modes in effect:
  etags-regen-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  doom-modeline-mode: t
  TeX-PDF-mode: t
  global-java-ide-mode: t
  global-treesit-auto-mode: t
  winner-mode: t
  global-so-long-mode: t
  recentf-mode: t
  nerd-icons-completion-mode: t
  marginalia-mode: t
  corfu-popupinfo-mode: t
  savehist-mode: t
  corfu-history-mode: t
  global-corfu-mode: t
  corfu-mode: t
  vertico-mode: t
  global-completion-preview-mode: t
  display-time-mode: t
  pixel-scroll-precision-mode: t
  override-global-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
c:/Users/Magiel Bruntink/.emacs.d/elpa/transient-20240311.1638/transient hides c:/Tools/MSYS2/ucrt64/share/emacs/29.3/lisp/transient
c:/Users/Magiel Bruntink/.emacs.d/elpa/modus-themes-20240317.1619/theme-loaddefs hides c:/Tools/MSYS2/ucrt64/share/emacs/29.3/lisp/theme-loaddefs
c:/Users/Magiel Bruntink/.emacs.d/site-lisp/loaddefs hides c:/Tools/MSYS2/ucrt64/share/emacs/29.3/lisp/loaddefs
c:/Users/Magiel Bruntink/.emacs.d/elpa/jsonrpc-1.0.25/jsonrpc hides c:/Tools/MSYS2/ucrt64/share/emacs/29.3/lisp/jsonrpc
c:/Users/Magiel Bruntink/.emacs.d/elpa/eglot-1.17/eglot hides c:/Tools/MSYS2/ucrt64/share/emacs/29.3/lisp/progmodes/eglot
c:/Users/Magiel Bruntink/.emacs.d/elpa/eldoc-1.15.0/eldoc hides c:/Tools/MSYS2/ucrt64/share/emacs/29.3/lisp/emacs-lisp/eldoc

Features:
(shadow sort mail-extr emacsbug magit-patch magit-subtree magit-gitignore
magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util etags fileloop helpful cc-langs trace edebug info-look
elisp-refs consult-xref c++-ts-mode c-ts-mode c-ts-common smartparens-c cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
cl-print shortdoc help-fns embark-org embark-consult embark ffap etags-regen
loaddefs-gen lisp-mnt radix-tree autoconf autoconf-mode sh-script smie
executable magit-extras pcmpl-unix magit-bookmark magit-submodule magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log which-func
magit-diff smerge-mode git-commit log-edit add-log magit-core magit-autorevert
autorevert magit-margin magit-transient magit-process with-editor magit-mode
transient magit-git magit-base magit-section tramp-cmds em-unix em-term term
ehelp em-script em-prompt em-hist em-pred em-glob em-extpipe em-cmpl em-basic
em-banner em-alias eshell-prompt-extras tramp tramp-loaddefs trampver
tramp-integration tramp-compat shell em-dirs esh-var esh-mode em-ls eshell
esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
ace-window avy org-modern org-indent image-file image-converter oc-basic ol-eww
eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art
mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-async nntp gnus-sum shr
pixel-fill kinsoku url-file gnus-group gnus-undo gnus-start gnus-dbus dbus
gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int
gnus-range message sendmail yank-media puny rfc822 mml mml-sec epa derived
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util mail-utils
range mm-util mail-prsvr ol-docview doc-view jka-compr image-mode exif ol-bibtex
bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi smartparens-org
org-calendar-smart-time-grid org-agenda org-element org-persist xdg org-id
avl-tree generator org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote
org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle
org-table ol org-fold org-fold-core org-keys oc org-loaddefs cal-menu calendar
cal-loaddefs org-version org-compat org-macs format-spec misearch multi-isearch
dired-aux vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs nerd-icons-dired
diff-hl-dired time-date mule-util cursor-sensor consult bookmark pulse color
visual-fill-column svg dom xml gtags-mode files-x server ligature diff-hl
log-view pcvs-util vc-dir vc cus-start doom-modeline doom-modeline-segments
doom-modeline-env doom-modeline-core shrink-path f preview-dvisvgm face-remap
preview auctex-latexmk smartparens-latex latex latex-flymake tex-ispell
tex-style tex crm texmathp java-ide eglot external-completion jsonrpc
flymake-proc flymake diff ert ewoc debug backtrace find-func filenotify compile
text-property-search comint ansi-osc imenu smartparens-config smartparens-text
smartparens advice loadhist thingatpt treesit-auto treesit ansi-color dumb-jump
popup dash s xref project winner ibuf-macs so-long recentf tree-widget dired
dired-loaddefs nerd-icons-completion marginalia cape corfu-popupinfo savehist
corfu-history nerd-icons-corfu corfu orderless vertico compat completion-preview
edmacro kmacro modus-vivendi-tritanopia-theme modus-operandi-tritanopia-theme
modus-vivendi-deuteranopia-theme modus-operandi-deuteranopia-theme
modus-vivendi-tinted-theme modus-operandi-tinted-theme modus-vivendi-theme
modus-operandi-theme modus-themes nerd-icons nerd-icons-faces nerd-icons-data
nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon
nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon
nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon time pixel-scroll cua-base ring
display-line-numbers auctex-latexmk-autoloads blamer-autoloads async-autoloads
cape-autoloads consult-eglot-autoloads copilot-autoloads corfu-autoloads
csv-mode-autoloads dape-autoloads diff-hl-autoloads dired-collapse-autoloads
dired-narrow-autoloads dired-ranger-autoloads dired-subtree-autoloads
dired-hacks-utils-autoloads disk-usage-autoloads docker-autoloads aio-autoloads
dockerfile-mode-autoloads doom-modeline-autoloads dumb-jump-autoloads
ebdb-autoloads editorconfig-autoloads eglot-autoloads eldoc-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
eshell-prompt-extras-autoloads ess-autoloads gnu-elpa-keyring-update-autoloads
epg rfc6068 epg-config gnu-elpa-keyring-update gptel-autoloads
gtags-mode-autoloads helpful-autoloads elisp-refs-autoloads
ibuffer-project-autoloads interaction-log-autoloads jsonrpc-autoloads
kotlin-ts-mode-autoloads kubernetes-autoloads ligature-autoloads
lua-mode-autoloads magit-autoloads pcase git-commit-autoloads
magit-popup-autoloads magit-section-autoloads marginalia-autoloads
modus-themes-autoloads nerd-icons-completion-autoloads
nerd-icons-corfu-autoloads nerd-icons-dired-autoloads
nerd-icons-ibuffer-autoloads orderless-autoloads org-modern-autoloads
osm-autoloads pdf-tools-autoloads poly-R-autoloads poly-noweb-autoloads
pomidor-autoloads alert-autoloads log4e-autoloads gntp-autoloads popup-autoloads
preview-dvisvgm-autoloads auctex-autoloads tex-site pytest-autoloads
pyvenv-autoloads qrencode-autoloads quarto-mode-autoloads
poly-markdown-autoloads markdown-mode-autoloads polymode-autoloads
rainbow-mode-autoloads request-autoloads rust-mode-autoloads
shrink-path-autoloads f-autoloads smartparens-autoloads tablist-autoloads
transient-autoloads treemacs-nerd-icons-autoloads treemacs-autoloads
cfrs-autoloads posframe-autoloads ht-autoloads hydra-autoloads lv-autoloads
pfuture-autoloads ace-window-autoloads avy-autoloads s-autoloads dash-autoloads
nerd-icons-autoloads treesit-auto-autoloads unfill-autoloads vertico-autoloads
visual-regexp-autoloads wgrep-autoloads with-editor-autoloads compat-autoloads
info writeroom-mode-autoloads visual-fill-column-autoloads yaml-mode-autoloads
vc-git diff-mode vc-dispatcher use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source eieio eieio-core
password-cache json map byte-opt url-vars auto-compile comp comp-cstr warnings
subr-x rx cl-macs gv cl-extra help-mode cl-seq bytecomp byte-compile cus-edit pp
cus-load icons wid-edit cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian
philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet
lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded
button loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule custom widget
keymap hashtable-print-readable backquote threads w32notify w32 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1066771 54399)
 (symbols 48 51400 0)
 (strings 32 230776 12295)
 (string-bytes 1 8110103)
 (vectors 16 107827)
 (vector-slots 8 2288876 93154)
 (floats 8 2132 451)
 (intervals 56 8437 1030)
 (buffers 984 40))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70329; Package emacs. (Thu, 11 Apr 2024 07:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 70329 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Magiel Bruntink <magiel.bruntink <at> icloud.com>
Cc: 70329 <at> debbugs.gnu.org
Subject: Re: bug#70329: 29.3;
 etags-regen-mode fails in projects that have spaces in their root
 path elements
Date: Thu, 11 Apr 2024 10:29:43 +0300
> Date: Wed, 10 Apr 2024 21:32:57 +0200
> From:  Magiel Bruntink via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> I wanted to try to the new etags-regen-mode and loaded its lisp manually.
> 
> There is an issue with how the new mode deals with paths containing spaces,
> however.
> 
> Running the etags--xref-backend through eg. xref-find-definitions
> within a file in a project that has spaces in its path elements,
> eg. "c:/temp/test project/test.c" will cause an error.
> 
> Messages seen are:
> Generating new tags table...
> (Shell command failed with code 1 and some error output)
> visit-tags-table-buffer: File c:/temp/test project/TAGS does not exist
> 
> Error message in the etags-regen-tags-errors* buffer:
> c:/temp/test: Permission denied

Stab in the dark: does the patch below fix the problem?

If not, please repeat your recipe with debug-on-error non-nil, and
post the backtrace here.

diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
index 6cd78d3..02d666c 100644
--- a/lisp/progmodes/etags-regen.el
+++ b/lisp/progmodes/etags-regen.el
@@ -279,7 +279,7 @@ etags-regen--tags-generate
                                      " ")
                           ;; ctags's etags requires '-L' for stdin input.
                           (if ctags-p "-L" "")
-                          tags-file)))
+                          (shell-quote-argument tags-file))))
     (with-temp-buffer
       (mapc (lambda (f)
               (insert f "\n"))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70329; Package emacs. (Thu, 11 Apr 2024 14:49:06 GMT) Full text and rfc822 format available.

Message #11 received at 70329 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Magiel Bruntink <magiel.bruntink <at> icloud.com>,
 Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 70329 <at> debbugs.gnu.org
Subject: Re: bug#70329: 29.3; etags-regen-mode fails in projects that have
 spaces in their root path elements
Date: Thu, 11 Apr 2024 17:48:19 +0300
> From: Magiel Bruntink <magiel.bruntink <at> icloud.com>
> Date: Thu, 11 Apr 2024 16:30:09 +0200
> 
> Yes, problem fixed with your patch. Nice!

Thanks for testing it.  I will wait for Dmitry to chime in before
installing this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70329; Package emacs. (Thu, 11 Apr 2024 16:18:01 GMT) Full text and rfc822 format available.

Message #14 received at 70329 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Magiel Bruntink <magiel.bruntink <at> icloud.com>
Cc: 70329 <at> debbugs.gnu.org
Subject: Re: bug#70329: 29.3; etags-regen-mode fails in projects that have
 spaces in their root path elements
Date: Thu, 11 Apr 2024 19:17:32 +0300
[Please use Reply All to reply, to keep the bug tracker CC'ed.]

> From: Magiel Bruntink <magiel.bruntink <at> icloud.com>
> Date: Thu, 11 Apr 2024 17:43:36 +0200
> 
> No problem, thanks for the fix.
> 
> While applying your patch I found a similar issue with ediff-ptch.el though. It
> won't find the to-be-patched file if there are spaces involved in the path.
> 
> Here is the patch for it :-)

Thanks.  I installed a slightly more radical change instead:

diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index f8d4c1c..2d5d460 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -721,10 +721,11 @@ ediff-patch-file-internal
 	     nil ; don't redisplay
 	     shell-command-switch   ; usually -c
 	     (format "%s %s %s %s"
-		     ediff-patch-program
+		     (shell-quote-argument ediff-patch-program)
 		     ediff-patch-options
 		     ediff-backup-specs
-		     (ediff--buffer-file-name buf-to-patch))
+                     (shell-quote-argument
+		      (ediff--buffer-file-name buf-to-patch)))
 	     ))
 
       ;; restore environment for gnu patch




Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Thu, 11 Apr 2024 17:12:03 GMT) Full text and rfc822 format available.

Notification sent to Magiel Bruntink <magiel.bruntink <at> icloud.com>:
bug acknowledged by developer. (Thu, 11 Apr 2024 17:12:03 GMT) Full text and rfc822 format available.

Message #19 received at 70329-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>, Magiel Bruntink <magiel.bruntink <at> icloud.com>
Cc: 70329-done <at> debbugs.gnu.org
Subject: Re: bug#70329: 29.3; etags-regen-mode fails in projects that have
 spaces in their root path elements
Date: Thu, 11 Apr 2024 20:10:55 +0300
Hi Eli and Magiel,

On 11/04/2024 10:29, Eli Zaretskii wrote:
>> Date: Wed, 10 Apr 2024 21:32:57 +0200
>> From:  Magiel Bruntink via "Bug reports for GNU Emacs,
>>   the Swiss army knife of text editors"<bug-gnu-emacs <at> gnu.org>
>>
>> I wanted to try to the new etags-regen-mode and loaded its lisp manually.
>>
>> There is an issue with how the new mode deals with paths containing spaces,
>> however.
>>
>> Running the etags--xref-backend through eg. xref-find-definitions
>> within a file in a project that has spaces in its path elements,
>> eg. "c:/temp/test project/test.c" will cause an error.
>>
>> Messages seen are:
>> Generating new tags table...
>> (Shell command failed with code 1 and some error output)
>> visit-tags-table-buffer: File c:/temp/test project/TAGS does not exist
>>
>> Error message in the etags-regen-tags-errors* buffer:
>> c:/temp/test: Permission denied
> Stab in the dark: does the patch below fix the problem?
> 
> If not, please repeat your recipe with debug-on-error non-nil, and
> post the backtrace here.
> 
> diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el
> index 6cd78d3..02d666c 100644
> --- a/lisp/progmodes/etags-regen.el
> +++ b/lisp/progmodes/etags-regen.el
> @@ -279,7 +279,7 @@ etags-regen--tags-generate
>                                        " ")
>                             ;; ctags's etags requires '-L' for stdin input.
>                             (if ctags-p "-L" "")
> -                          tags-file)))
> +                          (shell-quote-argument tags-file))))
>       (with-temp-buffer
>         (mapc (lambda (f)
>                 (insert f "\n"))

Thank you, looks good, pushed to master.




This bug report was last modified 23 days ago.

Previous Next


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