emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] `org-ctags-create-tags` creates empty TAGS file [9.6.15 (rel


From: Max Nikulin
Subject: Re: [PATCH] `org-ctags-create-tags` creates empty TAGS file [9.6.15 (release_9.6.15 @ /home/martin/Projects/emacs/lisp/org/)]
Date: Tue, 19 Mar 2024 17:21:51 +0700
User-agent: Mozilla Thunderbird

On 11/02/2024 04:10, Morgan Willcock wrote:

The shell expansion should work if the asterisk is outside of the
quotes.  I've attached an (untested) patch to explain what I mean.

Never try to quote arbitrary strings by double or single quotes in shell. There are enough fancy characters that may be interpreted in a special way. The safest approach is to use `process-file' instead of `shell-command', but in the case of a remote file shell is unavoidable and would require additional round trip for `file-expand-wildcards'.

The committed change is anyway incomplete.

+++ b/lisp/org-ctags.el
@@ -484,11 +484,11 @@ defun org-ctags-create-tags
       (setq exitcode
             (shell-command
              (format (concat "%s --langdef=orgmode --langmap=orgmode:.org "
-                             "--regex-orgmode=\"%s\" -f \"%s\" -e -R %s")
+                             "--regex-orgmode=\"%s\" -f \"%s\" -e -R \"%s\"*")
-----------------------------------------------------------^^^^^^
These quote characters should be removed as well

                      org-ctags-path-to-ctags
                      org-ctags-tag-regexp
                      (expand-file-name (concat dir-name "/TAGS"))
It requires `shell-quote-argument' as well

-                     (expand-file-name (concat dir-name "/*")))))
+                     (expand-file-name (concat dir-name "/")))))
       (cond
        ((eql 0 exitcode)
         (setq-local org-ctags-tag-list






reply via email to

[Prev in Thread] Current Thread [Next in Thread]