From: Morgan Willcock <morgan@ice9.digital>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Martin Marshall <law@martinmarshall.com>, emacs-orgmode@gnu.org
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: Sat, 10 Feb 2024 21:10:55 +0000 [thread overview]
Message-ID: <86y1bsowio.fsf@ice9.digital> (raw)
In-Reply-To: <874jegqts6.fsf@localhost> (Ihor Radchenko's message of "Sat, 10 Feb 2024 14:27:05 +0000")
[-- Attachment #1: Type: text/plain, Size: 978 bytes --]
Ihor Radchenko <yantar92@posteo.net> writes:
> Martin Marshall <law@martinmarshall.com> writes:
>
>> Hi, the docstring of `org-ctags-create-tags` says it should "(Re)create
>> tags file in the directory of the active buffer," creating tags from the
>> internal links found in the org files. However, it always creates an
>> empty TAGS file.
>>
>> The cause appears to be a pair of escaped quotes used with
>> `shell-command` when it calls the "ctags" executable.
>> ...
>> I've attached a patch against the current Emacs master branch. I hope
>> that's sufficient, given the minimal nature of the change.
>
> Thanks!
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=981402a93
Doesn't this change mean that it will now break when the expanded path
has whitespace characters in it?
The shell expansion should work if the asterisk is outside of the
quotes. I've attached an (untested) patch to explain what I mean.
--
Morgan Willcock
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-ctags.el-Quote-directory-name-for-ctags-shell-co.patch --]
[-- Type: text/x-patch, Size: 1355 bytes --]
From b5f52034b693175df2ec057cb5e9e4de55e70078 Mon Sep 17 00:00:00 2001
From: Morgan Willcock <morgan@ice9.digital>
Date: Sat, 10 Feb 2024 21:02:30 +0000
Subject: [PATCH] org-ctags.el: Quote directory name for "ctags" shell command
* lisp/org-ctags.el (org-ctags-create-tags): Expand the quoted form of
the directory name in the "ctags" shell command. This allows the
directory name to contain whitespace characters.
---
lisp/org-ctags.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/org-ctags.el b/lisp/org-ctags.el
index 693ccc87b..49c1d1228 100644
--- a/lisp/org-ctags.el
+++ 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\"*")
org-ctags-path-to-ctags
org-ctags-tag-regexp
(expand-file-name (concat dir-name "/TAGS"))
- (expand-file-name (concat dir-name "/*")))))
+ (expand-file-name (concat dir-name "/")))))
(cond
((eql 0 exitcode)
(setq-local org-ctags-tag-list
--
2.41.0.windows.3
next prev parent reply other threads:[~2024-02-10 21:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 23:57 [PATCH] `org-ctags-create-tags` creates empty TAGS file [9.6.15 (release_9.6.15 @ /home/martin/Projects/emacs/lisp/org/)] Martin Marshall
2024-02-10 4:49 ` Is there something people use instead of org-ctags? (was: [PATCH] `org-ctags-create-tags` creates empty TAGS file) Martin Marshall
2024-02-10 14:29 ` Ihor Radchenko
2024-02-10 14:27 ` [PATCH] `org-ctags-create-tags` creates empty TAGS file [9.6.15 (release_9.6.15 @ /home/martin/Projects/emacs/lisp/org/)] Ihor Radchenko
2024-02-10 21:10 ` Morgan Willcock [this message]
2024-02-10 21:20 ` Ihor Radchenko
2024-03-19 10:21 ` Max Nikulin
2024-03-20 12:08 ` Ihor Radchenko
2024-04-28 7:37 ` [PATCH] org-ctags.el: Protect shell specials in directory name Max Nikulin
2024-04-28 12:53 ` Ihor Radchenko
2024-04-28 16:51 ` Max Nikulin
2024-04-28 16:55 ` Ihor Radchenko
2024-04-28 16:58 ` Max Nikulin
2024-04-28 17:02 ` Ihor Radchenko
2024-04-29 10:26 ` Max Nikulin
2024-04-29 13:12 ` Ihor Radchenko
2024-04-29 16:54 ` [PATCH] org-ctags.el: Do not activate on load Max Nikulin
2024-04-30 10:02 ` Ihor Radchenko
2024-04-30 11:20 ` [PATCH] org.el: Call EXT-enable for `org-modules' (was Re: [PATCH] org-ctags.el: Do not activate on load) Max Nikulin
2024-05-01 10:21 ` Ihor Radchenko
2024-05-01 11:38 ` Max Nikulin
2024-05-01 13:57 ` Ihor Radchenko
2024-04-30 12:59 ` [PATCH] org-ctags.el: Do not activate on load Ihor Radchenko
2024-04-30 13:37 ` Max Nikulin
2024-04-30 15:31 ` Ihor Radchenko
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.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86y1bsowio.fsf@ice9.digital \
--to=morgan@ice9.digital \
--cc=emacs-orgmode@gnu.org \
--cc=law@martinmarshall.com \
--cc=yantar92@posteo.net \
/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/org-mode.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).