From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 4ENeD5fmx2XIggAAe85BDQ:P1 (envelope-from ) for ; Sat, 10 Feb 2024 22:11:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4ENeD5fmx2XIggAAe85BDQ (envelope-from ) for ; Sat, 10 Feb 2024 22:11:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ice9.digital header.s=gm1 header.b=D689I6ry; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707599511; a=rsa-sha256; cv=none; b=Qt2vfUzA4GQFzSfKfZcfax93HDLiC941W5FbYLOrIsgM0iT6McGjf/QMdggZDdK+wzGzR2 SrJa5BV6QxcGEJUKCfdc+AmqZl87eTArA4YveN3hzrkqZCGNhg+wvH77dVqs5Kg/x2Ee2S yrvVXp1Cz/y5IMxMqmoK1R02InJGGW3A7VaesNYO/L+Bu7L6wAQMrvcjF6Hd91l8dnw3Fq 6Lmigo2siSGatQQvd5VQ/9eBaGMTJIdJjlwWk4yP+sxGWlq9X0THN/Uuf3aPVTvUClCUBY 3G6uBA/QxLjtKPgYuW2NyYccmzIZnD8E3EsmAItj871v6/vSaPeGWHKvMV2S7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ice9.digital header.s=gm1 header.b=D689I6ry; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707599511; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=icpJDFqFNqvLqm6MGNSN1Yf3f+c8ZmzmGI9jH/l5Dio=; b=OXmVDuauEfUqBiRroM0hkIMpOwWQy17QiddpC/A01aL1I3So/7r8vzRLf9QN2P1lMdBxjt cbIM+jl/LCTFLn9wrKVi5WFZ7PQWHUDStz56HTmJzyp3UfW4uEWROzeFr5TSh25bcku0ac I+dsNm7xmTevTcahi9WX+ITu+6GdIoOeO7OASErNrYJid1lIvZMVG4c81t1JAz6SIphqoa Xb1ErxSoYER1YqA4TDcQhtMoGopXaiuBzrH5rrP0+0Aduzw5CWGOYN4X5J1Ws4Y+ESseOv qf5FixJuKMa9nHCTO3nnL8TX8QLG2qTxLcPwFVK3M3cjncKHYQUa5Goc92uL5A== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 71B4520AD8 for ; Sat, 10 Feb 2024 22:11:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYucu-0003lb-Kq; Sat, 10 Feb 2024 16:11:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYucs-0003lQ-Nr for emacs-orgmode@gnu.org; Sat, 10 Feb 2024 16:11:06 -0500 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYuco-0007W8-6e for emacs-orgmode@gnu.org; Sat, 10 Feb 2024 16:11:06 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9AD4840004; Sat, 10 Feb 2024 21:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1707599456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=icpJDFqFNqvLqm6MGNSN1Yf3f+c8ZmzmGI9jH/l5Dio=; b=D689I6ryfECqXa869pNrnEmAxZOs2WOuyQQQeMPD478v2cKPbFmYuEikxmNwVA08jF3WjD 4NGjPPiQTnlH72lKxXe5Nvt2DOri6LEsqAku1o1hBWHAIMNLkAY2jshm6wYfoQtnyYEqDH bI5itLchpfLc0LWGCiylb/R41Cplhtks/UOim9iwsVRSucN/xOU2gDv745CCc6GbF8Bx5I j4e6HdqFy71StlSHwq5m7pYkBz2Xq5DuAR7/wygQbo9GkxVZC4e6BkyGkfvKUNSb6sTB0W u4Ft3YQlTKvNric41Nlh5cFkrG1OSCs5PsbozyB2YWKoNyQFY+lW4ooT/bMjhw== From: Morgan Willcock To: Ihor Radchenko Cc: Martin Marshall , 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/)] In-Reply-To: <874jegqts6.fsf@localhost> (Ihor Radchenko's message of "Sat, 10 Feb 2024 14:27:05 +0000") References: <874jegqts6.fsf@localhost> Date: Sat, 10 Feb 2024 21:10:55 +0000 Message-ID: <86y1bsowio.fsf@ice9.digital> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: morgan@ice9.digital Received-SPF: pass client-ip=2001:4b98:dc4:8::222; envelope-from=morgan@ice9.digital; helo=relay2-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Spam-Score: -9.71 X-Migadu-Queue-Id: 71B4520AD8 X-Migadu-Spam-Score: -9.71 X-TUID: 7HNbY22Unyyw --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Martin Marshall 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-ctags.el-Quote-directory-name-for-ctags-shell-co.patch >From b5f52034b693175df2ec057cb5e9e4de55e70078 Mon Sep 17 00:00:00 2001 From: Morgan Willcock 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 --=-=-=--