Received: (at 35964) by debbugs.gnu.org; 20 Jun 2019 10:42:19 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 20 06:42:19 2019 Received: from localhost ([127.0.0.1]:47918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hduWI-0007Mf-T8 for submit <at> debbugs.gnu.org; Thu, 20 Jun 2019 06:42:19 -0400 Received: from smtp1.inetd.co.jp ([210.129.88.11]:51552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ikumi@HIDDEN>) id 1hduWH-0007MS-09 for 35964 <at> debbugs.gnu.org; Thu, 20 Jun 2019 06:42:17 -0400 Received: from localhost (210-20-196-114.rev.home.ne.jp [210.20.196.114]) by smtp1.inetd.co.jp (Postfix) with ESMTPA id 8F818A3; Thu, 20 Jun 2019 19:42:13 +0900 (JST) From: Ikumi Keita <ikumi@HIDDEN> To: Jan Seeger <jan.seeger+auctex@HIDDEN> Subject: Re: bug#35964: TeX-strip-extension not doing what's documented, TeX-master-file always returning relative name In-reply-to: <ffac8d3ca4213ed57e471863990a1dbb@HIDDEN> References: <a9b7d741bdc653677a0cdb32fa467296@HIDDEN> <87971.1560946859@localhost> <ffac8d3ca4213ed57e471863990a1dbb@HIDDEN> Comments: In-reply-to Jan Seeger <jan.seeger+auctex@HIDDEN> message dated "Thu, 20 Jun 2019 09:45:25 +0200." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <93559.1561027333.1@localhost> Date: Thu, 20 Jun 2019 19:42:13 +0900 Message-ID: <93561.1561027333@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35964 Cc: 35964 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Jan, Please keep 35964 <at> debbugs.gnu.org in Cc: when you reply. >>>>> Jan Seeger <jan.seeger+auctex@HIDDEN> writes: > If there is a better way to get the absolute path of the master file, > let me know! How about "%a" defined in `TeX-expand-list-builtin' instead of your "%(abs)"? (Ah, but it seems to my eyes not to return the expected file name when used with partical typeset like C-c C-r and so on... If that is problematic for you, please let us know.) > To explain some backstory: I've added a custom viewer (Foxit) with an > argument that allows automatic reloading on Windows. However, Foxit is > a multi-document application, so the working directory of the current > Foxit instance might not be the same as that of Emacs. So Foxit > requires the absolute path to be able to open the file. [ ... ] > During this, I found out that `TeX-master-file` will not return > absolute paths, even if the `nondirectory` argument is nil. I have an impression that many part of of AUCTeX expects master file name to be without directory part. So I don't think that it is a good idea to change `TeX-master-file' to return absolute path every time its third argument is nil. >> Sorry, I don't quite understand what you write here: >> (1) The line 2332 in tex.el of the current git master branch is just >> (defun TeX-master-file (&optional extension nondirectory ask) >> . > This might be a version difference, I'll paste the modified code here > for convenience: > ----- > (let ((my-name (if (buffer-file-name) > (TeX-strip-extension nil (list > TeX-default-extension) nondirectory) > "<none>"))) > ----- > The existing code left out the `nondirectory` argument, causing > `TeX-strip-extension` to return a relative filename again. Thanks, I see. >> (2) Presuming that your NONDIR actually means NONDIRECTORY of >> `TeX-master-file', that must be non-nil in order to make difference in >> the behavior of `TeX-master-file' if NONDIRECTORY is forwarded to >> `TeX-strip-extension'. So the case that NONDIRECTORY is nil is not >> relevant. > The original line is this: > ----- > (let ((my-name (if (buffer-file-name) > (TeX-strip-extension nil (list TeX-default-extension) t) > "<none>"))) > ----- > which means that `my-name` is always the non-directory name, which is > not what the documentation of TeX-master-file states. IMHO, the sentence "If optional second argument NONDIRECTORY is non-nil, do not include the directory." in the doc string of `TeX-master-file' does not gurantee that it returns absolute path if NONDIRECTORY is nil. It just states the case when NONDIRECTORY is non-nil, and nothing when NONDIRECTORY is nil. I think `TeX-master-file' is designed so that (TeX-master-file) returns "main" in the buffer of main.tex and "../master" in the buffer of sub.tex with local variable specification %%% TeX-master: "../master" . Regards, Ikumi Keita
bug-auctex@HIDDEN
:bug#35964
; Package auctex
.
Full text available.Received: (at 35964) by debbugs.gnu.org; 19 Jun 2019 12:21:06 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 19 08:21:06 2019 Received: from localhost ([127.0.0.1]:46157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hdZaM-0001Uc-FV for submit <at> debbugs.gnu.org; Wed, 19 Jun 2019 08:21:06 -0400 Received: from smtp1.inetd.co.jp ([210.129.88.11]:34658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ikumi@HIDDEN>) id 1hdZaI-0001Tt-9E for 35964 <at> debbugs.gnu.org; Wed, 19 Jun 2019 08:21:05 -0400 Received: from localhost (210-20-196-114.rev.home.ne.jp [210.20.196.114]) by smtp1.inetd.co.jp (Postfix) with ESMTPA id BA754AD; Wed, 19 Jun 2019 21:20:59 +0900 (JST) From: Ikumi Keita <ikumi@HIDDEN> To: Jan Seeger <jan.seeger+auctex@HIDDEN> Subject: Re: bug#35964: TeX-strip-extension not doing what's documented, TeX-master-file always returning relative name In-reply-to: <a9b7d741bdc653677a0cdb32fa467296@HIDDEN> References: <a9b7d741bdc653677a0cdb32fa467296@HIDDEN> Comments: In-reply-to Jan Seeger <jan.seeger+auctex@HIDDEN> message dated "Tue, 28 May 2019 17:40:59 +0200." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <87970.1560946859.1@localhost> Date: Wed, 19 Jun 2019 21:20:59 +0900 Message-ID: <87971.1560946859@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35964 Cc: 35964 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Jan, sorry for very late reply. >>>>> Jan Seeger <jan.seeger+auctex@HIDDEN> writes: > However, the second case check is implemented without regard for the > special value 'path, and strips the directory even when NODIR is nil. > I've modified the check to > (if (or (eq nodir t) > (and (eq nodir 'path) > (or > (string-equal dir (expand-file-name "./")) > (member dir TeX-macro-global) > (member dir TeX-macro-private)))) > (file-name-nondirectory strip) > and this gives me an absolute path from `TeX-strip-extension`. Thanks for your suggestion. If I understand correctly, this change only affects the case NODIR is nil (or, more precisely, NODIR is neither t nor `path'.) Right? Though I agree that the current implementation of `TeX-strip-extension' doesn't match its doc string and the proposed change seems sensible, I'm worrying about the impact of this change. In `TeX-master-file', we read ---------------------------------------------------------------------- (if (TeX-match-extension name) ;; If it already has an extension... (if (equal extension TeX-default-extension) ;; Use instead of the default extension (setq extension nil) ;; Otherwise drop it. (setq name (TeX-strip-extension name)))) ---------------------------------------------------------------------- . This is the only place, if my brief survey is correct, in the current AUCTeX source where `TeX-strip-extension' is called with NODIR argument being nil. Are you sure that the proposed change brings no bad side effects? > Relatedly, `TeX-master-file` also fails to return an absolute path to > the master file if the `NONDIR` argument is nil because the `NONDIR` > argument is not forwarded to TeX-strip-extension, and thus always > returns a filename without directory part. The relevant line is line > 2332 in `tex.el`. Sorry, I don't quite understand what you write here: (1) The line 2332 in tex.el of the current git master branch is just (defun TeX-master-file (&optional extension nondirectory ask) . (2) Presuming that your NONDIR actually means NONDIRECTORY of `TeX-master-file', that must be non-nil in order to make difference in the behavior of `TeX-master-file' if NONDIRECTORY is forwarded to `TeX-strip-extension'. So the case that NONDIRECTORY is nil is not relevant. Best regards, Ikumi Keita
bug-auctex@HIDDEN
:bug#35964
; Package auctex
.
Full text available.Received: (at submit) by debbugs.gnu.org; 28 May 2019 16:32:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 12:32:57 2019 Received: from localhost ([127.0.0.1]:56977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hVf21-0007U0-D1 for submit <at> debbugs.gnu.org; Tue, 28 May 2019 12:32:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <jan.seeger+auctex@HIDDEN>) id 1hVek0-0004lp-Sc for submit <at> debbugs.gnu.org; Tue, 28 May 2019 12:14:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:39210) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <jan.seeger+auctex@HIDDEN>) id 1hVeju-0004Rl-RL for submit <at> debbugs.gnu.org; Tue, 28 May 2019 12:14:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <jan.seeger+auctex@HIDDEN>) id 1hVejt-0001XY-PI for bug-auctex@HIDDEN; Tue, 28 May 2019 12:14:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_50,RDNS_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <jan.seeger+auctex@HIDDEN>) id 1hVejm-0004EC-7r for bug-auctex@HIDDEN; Tue, 28 May 2019 12:14:09 -0400 Received: from [2a01:488:66:1000:5bfa:6508:0:1] (port=50948 helo=mail.thenybble.de) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <jan.seeger+auctex@HIDDEN>) id 1hVeji-0003do-Hd for bug-auctex@HIDDEN; Tue, 28 May 2019 12:14:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.thenybble.de; s=one; h=Message-ID:From:Date:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CGTYKwdg1AVAZ8Nmd9Yl8CsoPI4t4J+Tf7NqSx/F/Bs=; b=DLtqcVLt1cRs/XJ1MCBMbnwAI7 tz+Si07yEGA4Rd1z1Dk6dk4QmmBGVYSrAsLIkmc86GQiyOTEbqBifVChd2+WA1qAftBEWUXNSdMBA 2/KiPjzGyywBJUvd9tVIpMKB4+EBmt40oAfoVhpi9VzDQySo0W/aPnLO/1oDG8CUHtZjQDqrTTM8Y p0Fm6yk4dVivAYFFOXw3fk8SR9+Hr4HSdIMzzHX/kKSTYIZouYnf7hBlZ8BS5diC/p8A/7ew6iNcv S730cIMnzQuAxloWeuEMaUkEEdg7PTzpUyDDEnioN6uucSIWzfjQhgAZxF+MOZc3YAH4chA3/CzFU w+5YM1vg==; Received: from www-data by mail.thenybble.de with local (Exim 4.89) (envelope-from <jan.seeger+auctex@HIDDEN>) id 1hVeDj-0006gc-P6 for bug-auctex@HIDDEN; Tue, 28 May 2019 17:40:59 +0200 To: bug-auctex@HIDDEN Subject: TeX-strip-extension not doing what's documented, TeX-master-file always returning relative name MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 28 May 2019 17:40:59 +0200 From: Jan Seeger <jan.seeger+auctex@HIDDEN> Message-ID: <a9b7d741bdc653677a0cdb32fa467296@HIDDEN> X-Sender: jan.seeger+auctex@HIDDEN User-Agent: Roundcube Webmail/1.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:488:66:1000:5bfa:6508:0:1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 28 May 2019 12:32:56 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) Hey! While trying to get TeX-master-file to produce an absolute path, I found that the `nodir` argument to TeX-strip-extension was not doing what was expected. The filename was still getting stripped, and the code on lines 4393 to 4398 in `tex.el` was responsible for that. `TeX-strip-extension` is documented in the function's docstring to remove the directory name from the file name if (and only if): (1) The NODIR argument is `t` (2) The NODIR argument is `'path`, and the file is in the current directory or in the LaTeX macro path. However, the second case check is implemented without regard for the special value 'path, and strips the directory even when NODIR is nil. I've modified the check to (if (or (eq nodir t) (and (eq nodir 'path) (or (string-equal dir (expand-file-name "./")) (member dir TeX-macro-global) (member dir TeX-macro-private)))) (file-name-nondirectory strip) and this gives me an absolute path from `TeX-strip-extension`. Relatedly, `TeX-master-file` also fails to return an absolute path to the master file if the `NONDIR` argument is nil because the `NONDIR` argument is not forwarded to TeX-strip-extension, and thus always returns a filename without directory part. The relevant line is line 2332 in `tex.el`. I hope these fixes make sense, if you need any more info please do not hesitate to ask. Best regards, Jan
Jan Seeger <jan.seeger+auctex@HIDDEN>
:bug-auctex@HIDDEN
.
Full text available.bug-auctex@HIDDEN
:bug#35964
; Package auctex
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.