From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Walker Lynch via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#47048: dirtrack no longer parses long paths from prompt Date: Wed, 10 Mar 2021 14:48:49 +0100 Message-ID: Reply-To: thomas.lynch@reasoningtechnology.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000066740305bd2eeffb" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35667"; mail-complaints-to="usenet@ciao.gmane.io" To: 47048@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 10 14:50:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJzE8-00097a-FI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Mar 2021 14:50:16 +0100 Original-Received: from localhost ([::1]:51758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJzE7-00083H-FF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Mar 2021 08:50:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJzDu-00082l-M3 for bug-gnu-emacs@gnu.org; Wed, 10 Mar 2021 08:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJzDu-0002Ne-Df for bug-gnu-emacs@gnu.org; Wed, 10 Mar 2021 08:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lJzDu-0005Sx-7i for bug-gnu-emacs@gnu.org; Wed, 10 Mar 2021 08:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Walker Lynch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Mar 2021 13:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47048 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161538417220963 (code B ref -1); Wed, 10 Mar 2021 13:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Mar 2021 13:49:32 +0000 Original-Received: from localhost ([127.0.0.1]:49238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJzDQ-0005S3-9Q for submit@debbugs.gnu.org; Wed, 10 Mar 2021 08:49:32 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJzDP-0005Rw-9Y for submit@debbugs.gnu.org; Wed, 10 Mar 2021 08:49:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJzDP-0007gb-1A for bug-gnu-emacs@gnu.org; Wed, 10 Mar 2021 08:49:31 -0500 Original-Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:38513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJzDM-000230-Td for bug-gnu-emacs@gnu.org; Wed, 10 Mar 2021 08:49:30 -0500 Original-Received: by mail-pl1-x644.google.com with SMTP id s7so8505925plg.5 for ; Wed, 10 Mar 2021 05:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reasoningtechnology.com; s=google; h=mime-version:reply-to:from:date:message-id:subject:to; bh=ync3j4Gbmz0gyO3IlfZEeP78gn/qK+dsSek67nBf9EA=; b=S26VV0WWaAgIGVJ4p3EEDqt7Krat4Ws68ze+zSy1qOEdGAnQJ9RWJ1mBEEi9Ss4luT g0G8BYLjpv0IxfQ56vdNjK+wxtbCMpvYIJhI6MtiTlzZC5WOmQ6e1BYfuesaMPZmmpnC C6QYpr9pwLv3HWkP20nexhqW6L3CEn/Ol/f7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=ync3j4Gbmz0gyO3IlfZEeP78gn/qK+dsSek67nBf9EA=; b=Rcn9GJoutyBqtGDil+BjLtE9GsDdq6+ZeYO/+/Sx/Ye7bbXF9CJvx+avZEHjDNQrya E4inkUojmI2hhusITEIpm24Ij29CBALsM3HGfSau40Y3guXfKjZWc0Vn8BLmL5UETezT iysCxDDL3oEQ0BJlCQM9jFOP2mer8x2cj4uT7A38A/qboIttfKUw8HJUzcKvFNcvf/Nr y6bgcLK87JNGhuckL+w3JcpHoCZWIOdCJvjwuedWq20l7p4o9++pRiD7qvDMI8VTSdGl A2Q3l/sPcyI3dCSCjotQ6QrcRemJY6GphSjbek1bApy2htybWxWfKKKcHW0yxZmwswYn gc4Q== X-Gm-Message-State: AOAM533zK2P8MhmrNTbiZn9k65tD+cNsw7ZhxCKaO0Q/kI8GReZWyVn9 ZOa+1Y5K8FbQq6U64ATVTFNsKY3/aC4PdR/bxal3jxZhvyRNdEKs X-Google-Smtp-Source: ABdhPJzT+gqdMNZYfPGPmT8n2DMMyYGCrcFpoH1Z6yN50GJW97murWopluVrWsaKqBsE7oS0mmuzOKFxclRBTsHk+fk= X-Received: by 2002:a17:902:f242:b029:e4:6dfc:8c1f with SMTP id j2-20020a170902f242b02900e46dfc8c1fmr3199550plc.0.1615384166141; Wed, 10 Mar 2021 05:49:26 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=thomas.lynch@reasoningtechnology.com; helo=mail-pl1-x644.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" X-ACL-Warn: , Thomas Walker Lynch Xref: news.gmane.io gmane.emacs.bugs:201981 Archived-At: --00000000000066740305bd2eeffb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Fedora 33, emacs 27.1 Here are the dirtrack settings from .emacs, which is currently the only thing in .emacs: (add-hook 'shell-mode-hook (lambda () (shell-dirtrack-mode -1) (dirtrack-mode 1))) (add-hook 'dirtrack-directory-change-hook (lambda () (message default-directory))) (setq dirtrack-list '("=C2=A7\\(.*\\)=C2=A7\n> " 1)) This matches the prompt, from .bashrc: export PS1=3D'\n$(/usr/local/bin/Z)\n\u@\h=C2=A7\w=C2=A7\n> ' The following is from a shell running in emacs (M-x shell). It is a three line prompt, with the date, a path (which can be long) and then a simple prompt for the command. It is used for logged transcripts. 2021-03-10T12:30:08Z Morpheus@localhost=C2=A7~/tmp=C2=A7 > ls old We are in a temp directory under the home directory. It currently has one subdirectory called 'old'. dirtrack correctly followed us here, as we can tell from M-x pwd. I create two more directories, one with a short name, and one with a long name. 2021-03-10T12:30:10Z Morpheus@localhost=C2=A7~/tmp=C2=A7 > mkdir aaaaaa When I cd to this short name directory, dirtrack follows. Then I cd back up, and dirtrack follows. Now I make a directory with a long name. When I cd to it, dirtrack does not follow. Not only that, but it takes emacs back to the home directory. 2021-03-10T12:30:27Z Morpheus@localhost=C2=A7~/tmp=C2=A7 > mkdir bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb Note, in actual use, rather than just a simple test case, the long names are paths made of many short directory names. These paths are important for understanding the transcripts later. I guess this problem started with an update to Fedora 33, as have many other problems unrelated to emacs. However, I can not be sure because of the nature of the problem, only showing up with long path names. It might have come with a more recent package update. It is also possible this has something to do with regular expression matching. Due to the syntax of newling matching being different in regular expressions that are typed at emacs prompts such as M-x replace-regexp I could not copy paste to test, but when making the suitable edits, the regexp replace worked with the same strings as shown above. I am at a bit of a disadvantage, as this has worked for years, and I haven't looked at elisp in a long time. I certainly apologize if I missed a variable setting or missed something else simple. See also: https://pastebin.com/ptpUn8Pc https://imgur.com/a/Tft2krX https://imgur.com/a/FAD7EwJ Thomas --00000000000066740305bd2eeffb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Fedora 33,=C2=A0 emacs 27.1<= /div>

Here ar= e the dirtrack settings from .emacs, which is currently the only=C2=A0thing= in .emacs:

=C2=A0 (add-hook 'shell-mode-hook
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda ()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(shell-dirtr= ack-mode -1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0(dirtrack-mode 1)))

=C2=A0 (add-hook 'dirtrack-dir= ectory-change-hook
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (lambda ()
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message default-directory)))

=C2= =A0 (setq dirtrack-list '("=C2=A7\\(.*\\)=C2=A7\n> " 1))


This matches the pro= mpt, from .bashrc:
export P= S1=3D'\n$(/usr/local/bin/Z)\n\u@\h=C2=A7\w=C2=A7\n> '
=

The following is from a shell running i= n emacs (M-x shell)= .=C2=A0 It is=C2=A0 a three line prompt,=C2=A0with the date, a path (which = can be long) and then a simple prompt for the command. It is used for logge= d transcripts.

<= /blockquote>
2021-03-10T12:30:08Z
Morpheus@localhost= =C2=A7~/tmp=C2=A7
> ls
old<= /font>
We are in a= temp directory under the home directory.=C2=A0 It currently has one subdir= ectory called 'old'.=C2=A0 dirtrack correctly followed us here, as = we can tell from M-x pwd.=C2=A0 I create two more directories, one with a s= hort name, and one with a long name.

2021-03-10T12:30:10Z
Morpheus@localhost=C2=A7~/tmp=C2=A7
> mkdir aaaaaa

When I cd to this short name directory, dirtrack follows.=C2= =A0 Then I cd back up, and dirtrack follows.

Now I make a directory with a = long name.=C2=A0 When I cd to it, dirtrack=C2=A0does not follow. Not only t= hat, but it takes emacs back to the home directory.

2021-03-10T12:30:27Z
Morpheus@localhost=C2=A7~/tmp=C2=A7
= > mkdir bbbbbbbbbbbbbbbbbbbbb= bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

Note, in actual use, rather than just a simple test case, the = long names are paths made of many short directory=C2=A0names. These paths a= re important for understanding the transcripts later.

I guess this = problem started with an update to Fedora 33, as have many other problems un= related to emacs.=C2=A0 =C2=A0However, I can not be sure because of the nat= ure of the problem, only showing up with long path names.=C2=A0 It might ha= ve come with a more recent package update.

It is also possible this = has something to do with regular expression matching.=C2=A0 Due to the synt= ax of newling matching being different in regular expressions that are type= d at emacs prompts such as M-x replace-regexp I could not copy paste to tes= t, but when making the suitable edits, the regexp replace worked with the s= ame strings as shown above.

I am at a bit of a disadvantage, as this= has worked for years, and I haven't looked at elisp in a long time.=C2= =A0 I certainly apologize if I missed a variable setting or missed somethin= g else simple.=C2=A0

See also:
https://pastebin.com/ptpUn8Pc

--00000000000066740305bd2eeffb--