From unknown Sun Jun 22 11:36:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65120 <65120@debbugs.gnu.org> To: bug#65120 <65120@debbugs.gnu.org> Subject: Status: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory Reply-To: bug#65120 <65120@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:36:30 +0000 retitle 65120 29.1; directory-abbrev-alist breaks various things when insid= e an abbreviated directory reassign 65120 emacs submitter 65120 Sean Allred severity 65120 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 06 19:39:29 2023 Received: (at submit) by debbugs.gnu.org; 6 Aug 2023 23:39:29 +0000 Received: from localhost ([127.0.0.1]:60187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSnLN-00015Q-Bu for submit@debbugs.gnu.org; Sun, 06 Aug 2023 19:39:29 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSnLI-00015A-MP for submit@debbugs.gnu.org; Sun, 06 Aug 2023 19:39:28 -0400 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 1qSnLC-0004XW-Jd for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2023 19:39:18 -0400 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSnLB-0002cc-4U for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2023 19:39:18 -0400 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-583ad8ab0faso3162157b3.0 for ; Sun, 06 Aug 2023 16:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691365154; x=1691969954; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=YyMPOWuVYa4Uim8hYOjmMK5HyhsXFwo8Koe4Fr9K5e0=; b=rDzIVvcCISM0Yf46iEfAQxBmP4SVPba+VUXq33ztN0AtcObDE1xYlrkBW7wjc393SL HVlwjRZdkTDgwE0XdCUe1c49sITMNGKKoxSFgfSv6JvLLTOsUZNLyavO7B6acMkhIGwn HO+KlVdsm78fb8NjF1j0AbtHo65pnMma2L2y7Q8aN+4Ci1K/FbLSPLX1Dxl0YsEZiQsq MMr1P858xqACSP5CzTzKEpXBlkWHpmJ1HSBezQQqcptuReB2QxAL1FA014Zii4yW9jR9 q/YtPXTKmtZQ8G/VDm4Mffpn1mhWdNupnPf/cnvnN1mngJpdcSmLiUZ02bNJTccOWimH sn/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691365154; x=1691969954; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YyMPOWuVYa4Uim8hYOjmMK5HyhsXFwo8Koe4Fr9K5e0=; b=VujPQwD0U5L3qhqz7kPZjbpQwZgJz9uvzp+XKLkWPIdi6RH6o3Fx0OEr0hVWCiE0+p mWDNxtPSdiBsDtD57LKX5UbdO1X49cTP/sA+DiITbWjizgCjSDY47kt15w8Hy2VYhwyR Y6ShofYENkvRI/y7E9y8JiSZ5/dwqq21KppCrAqE5rk2H7AWf0JHXFeW7ISWN0EmDwSf Rz1YWB7M12fmIhcR3oQxZIVEZDyTpGWDAZw6ROB5jKtoenn0ECp6CRdCTNeLeFrUzvE8 73aIM6uI5xjfrbh5nsaHHbg2767ziinB7DNMVijk0C7SjG9HJ2p6k/oWimlgZ/joFKIo RMrA== X-Gm-Message-State: ABy/qLbguMholtcqkWzqTt5XYpBTj20GWVdCxu2+TW/hyyDkHgX1Hqdf eMv+lpzJw1SIELjzdqNhYgmlVNxugIU= X-Google-Smtp-Source: APBJJlE88N3ulQlecwWQEOsvU+P+NzZOA/5oQ1T5umZ3P8UPydRzbL2IjcJKs42IBfmGIIkLBgX3uw== X-Received: by 2002:a25:ce43:0:b0:ce9:273a:16a6 with SMTP id x64-20020a25ce43000000b00ce9273a16a6mr12019241ybe.0.1691365154492; Sun, 06 Aug 2023 16:39:14 -0700 (PDT) Received: from epic96565.epic.com ([2620:72:0:6480::1f3]) by smtp.gmail.com with ESMTPSA id r9-20020a258449000000b00d51f2b8e7fdsm381789ybm.55.2023.08.06.16.39.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 16:39:13 -0700 (PDT) User-agent: mu4e 1.11.1; emacs 29.1 From: Sean Allred To: bug-gnu-emacs@gnu.org Subject: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory Date: Sun, 06 Aug 2023 18:35:22 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1136; envelope-from=allred.sean@gmail.com; helo=mail-yw1-x1136.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, FREEMAIL_FROM=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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Emacs behaves oddly inside abbreviated directories when `directory-abbrev-alist' is set. $ emacs -Q lisp> (setq directory-abbrev-alist `(("~/tmp" . "tmp"))) keys> C-x d ~/tmp RET keys> C-x C-f I see "tmp/" in the minibuffer and no completions are available. I've also seen (dired "~/tmp") fail on Windows in this scenario -- complaining that the directory is inaccessible. On both systems, ~/tmp does exist (and has content) and behaves as expected if `directory-abbrev-alist' is nil. Paring down to a minimal example on Windows is considerably more work than it is on *nix, though, and I suspect the two symptoms have the same root cause. Nevertheless, if it should help, I can do that leg-work sometime this week. --- In GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2023-07-30 built on armbob.lan Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.5 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no' Configured features: ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix -- Sean Allred From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 07 11:45:44 2023 Received: (at 65120) by debbugs.gnu.org; 7 Aug 2023 15:45:44 +0000 Received: from localhost ([127.0.0.1]:34120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT2QS-0001KK-7e for submit@debbugs.gnu.org; Mon, 07 Aug 2023 11:45:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT2QQ-0001JF-1T for 65120@debbugs.gnu.org; Mon, 07 Aug 2023 11:45:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qT2QK-0008Pw-O8; Mon, 07 Aug 2023 11:45:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MFI9i3SSvagyMViYaKqNtegwAguBkygv2c0+TPZP7Mw=; b=Z8GWbDQoxYn/ lVcNWpS1K8hyV+ei2kIaUScxVm2FiGYjNYf96VP7Ip8NVIw70b0nYfB1w7DFw5sFdYOyX+D3s/1PG TFdSRMhaVM0hVA+3dRks+2oqFyJHl9tnie6PS1+KYDFzjvYmR63S5GoUCjRuZ18LXxLve4JGdR7p0 XkHZAmnYVkGg515NNMKQomIl6S9kHuLHn9DCyWL8OGWsAmJU8JjspLvZKrfjD15z6w8PG/7olbw3e n8DpSpkof5BeI0xcIhMuTUF5fgcmiOs8ejnq2+8JUug2DCBfgSfArYBS7LXXK6LNoMnRoGJBR6LAV FEEel+BNrcxLWeX1pgVUmQ==; Date: Mon, 07 Aug 2023 18:45:55 +0300 Message-Id: <83leemonyk.fsf@gnu.org> From: Eli Zaretskii To: Sean Allred In-Reply-To: (message from Sean Allred on Sun, 06 Aug 2023 18:35:22 -0500) Subject: Re: bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65120 Cc: 65120@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Allred > Date: Sun, 06 Aug 2023 18:35:22 -0500 > > Emacs behaves oddly inside abbreviated directories when > `directory-abbrev-alist' is set. > > $ emacs -Q > lisp> (setq directory-abbrev-alist `(("~/tmp" . "tmp"))) > keys> C-x d ~/tmp RET > keys> C-x C-f > > I see "tmp/" in the minibuffer and no completions are available. > > I've also seen (dired "~/tmp") fail on Windows in this scenario -- > complaining that the directory is inaccessible. On both systems, ~/tmp > does exist (and has content) and behaves as expected if > `directory-abbrev-alist' is nil. This is not how directory-abbrev-alist should be used, according to documentation. The cdr of each alist element ("tmp" in your case) is supposed to be an absolute file name, and "tmp" isn't. Also, the car of each element is supposed to be an anchored regexp. What did you want to accomplish with directory-abbrev-alist such as the above, and why did you want that? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 07:45:41 2023 Received: (at 65120) by debbugs.gnu.org; 9 Aug 2023 11:45:41 +0000 Received: from localhost ([127.0.0.1]:38396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qThdE-00021m-Pr for submit@debbugs.gnu.org; Wed, 09 Aug 2023 07:45:41 -0400 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]:41046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qThdC-00021Z-Nw for 65120@debbugs.gnu.org; Wed, 09 Aug 2023 07:45:39 -0400 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5862a72ddb9so5032467b3.0 for <65120@debbugs.gnu.org>; Wed, 09 Aug 2023 04:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691581533; x=1692186333; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=7ETDA/MOC5+ICsxtFGTXxGQXk+dUk7ms7sh37PINld8=; b=YOZJPz85likYSy4ThcDh5GZWv7I354TqyMHXlvUjIeINV7j8bPnUtnGFehY7Tld35c 8vL6vFW7imFwJvlIFY5LkYerDlGZ5EGuCygqJtQKLnwZvJ363Mh5SyAky5MmuHc/W01P 8eBbC2wmE29eSn4f4cpjHpPX2R6HsQSiYOQvV4G1cAU2xYk3tHfb9DIEJsE2LzYsLODW 662x3eX3Me6vrx8HKnCZG91VJd5IULUGgn2kZWjBeSyWSFoL60l7q83AYZ/SIC1VfEqN r24BdnAz7QpDWt3LVLDvGs4mpD6n2OwVX+u/3/1P5+ZhXA2URGlayRg8IMAlLHGrIlsh lEKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691581533; x=1692186333; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7ETDA/MOC5+ICsxtFGTXxGQXk+dUk7ms7sh37PINld8=; b=ErpGcxHo82+Nd0B5/Mip8ouhSjpLfYh1EK5KfjiIlK47YiwX5T21ViEtXBLpERXy1t 5r554sAywAOnsMcvULnZkNcLWKnFGD7p3EJtKOy0o7l3BD5k54F5xpV3W9645R+D9tV/ wk7IL+sp+O7iQYJtXWM5HohFQvBQs0DeGTHaMvHPXj4CodfI+mRinppiKfHtDYJ9qPlu 3TaiCLuOtS7TY7Kbxw7sc5u2WByF37XRM8ftkpjavhcPDtj7u5BV45UGG9MTnabRrflq +N2Luo1oEwc7G3LqbEQUuEHZi+V3It3lh+l2PpT3CRiREqW+GtMgG2e67mlRkPsBaRYM eGGg== X-Gm-Message-State: AOJu0YwVdpbsFIuCuqs0pUsR3Cg0LO7XQkS3XKUHHBV2GRI2TuBMaRoR x8z4/ugPdB63I01Ozdg4fwwLaavQ5H4= X-Google-Smtp-Source: AGHT+IHEJMuGMYqATMO87MyEnE2sEecgeyZTNrmu/Qvsfug8RbX94W3nPlYLdTrCqyPD8rxiA1Mcxw== X-Received: by 2002:a0d:df04:0:b0:583:cf8d:bc0e with SMTP id i4-20020a0ddf04000000b00583cf8dbc0emr1184039ywe.5.1691581532896; Wed, 09 Aug 2023 04:45:32 -0700 (PDT) Received: from epic96565.epic.com ([2620:72:0:6480::18f]) by smtp.gmail.com with ESMTPSA id t17-20020a81c251000000b005771872a8dbsm3879825ywg.132.2023.08.09.04.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 04:45:32 -0700 (PDT) References: <83leemonyk.fsf@gnu.org> User-agent: mu4e 1.11.1; emacs 29.1 From: Sean Allred To: Eli Zaretskii Subject: Re: bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory Date: Wed, 09 Aug 2023 06:28:55 -0500 In-reply-to: <83leemonyk.fsf@gnu.org> Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65120 Cc: Sean Allred , 65120@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > This is not how directory-abbrev-alist should be used, according to > documentation. The cdr of each alist element ("tmp" in your case) is > supposed to be an absolute file name, and "tmp" isn't. Also, the car > of each element is supposed to be an anchored regexp. > > What did you want to accomplish with directory-abbrev-alist such as > the above, and why did you want that? Ah, I missed this key part of the docstring of `directory-abbrev-alist'; my apologies for that: Use this feature when you have directories that you normally refer to via absolute symbolic links. Make TO the name of the link, and FROM a regexp matching the name it is linked to. I jumped the gun on that one a bit. These are definitely not actual symlinks. In fact, symlinks are categorically a no-go in the target environment -- Windows on a corporate network. Other solutions like junctions are probably not something my target audience is going to be comfortable maintaining. What I'm trying to do: I work on the internal tools team at a large-ish software company (~2500 devs). I'm creating a Magit 'distribution' of sorts for Windows to try to promote its adoption -- since it's the only application in which I can build first-class support for our workflows. Part of this support (since I'm developing to lower the barrier to entry for non-Emacs users) is the creation of a GUI menu that has all the different repositories and worktrees I can find on their system. The problem is that our standard folder structure for source code yields very long paths that look pretty ugly in this menu system. I'm talking things like 'C:/$MegaCorpSource/git/$host/project/path/here.git' and 'C:/$MegaCorpSource/$version/$SomeDevelopmentIdentifier'. For various reasons (mostly a _huge_ corpus of other tooling that relies on this structure), this path structure cannot change. I'm also not limited to things in $MegaCorpSource; I'm trying to collect all repositories in `magit-repository-directories'. So, I'd like to shorten this $MegaCorpSource path using built-in functionality where possible. My users aren't going to care about most of the path components. I can roll my own, but is there something like `abbreviate-file-name' that doesn't assume we're working with symlinks? (Should/could there be? Thoughts on whether or not it is A Good Idea(tm)?) -- Sean Allred From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 09:21:30 2023 Received: (at 65120) by debbugs.gnu.org; 9 Aug 2023 13:21:30 +0000 Received: from localhost ([127.0.0.1]:38535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTj7x-0007Sg-WA for submit@debbugs.gnu.org; Wed, 09 Aug 2023 09:21:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTj7v-0007SN-HO for 65120@debbugs.gnu.org; Wed, 09 Aug 2023 09:21:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTj7q-000707-BL; Wed, 09 Aug 2023 09:21:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vSIlUeg5TORG+DjZnaPQ0/bUUDVsF71op4bRxyuNmLM=; b=Gk5I4OHSQRkZ JlNvfqXPk8jmcikNqIJ3iIMnbYqzkY9nGUjK6foB0Ei2BTrZLhShgf1fwAuyhDBKG4bTxdzxbkgp/ Obcqe09rRJuIC448XJpyDRRq1icDyenSRoB+Q6vdi4pnzV+t8tW4hjDG9cdrJlW0+uTQivYrsjI0t qC+T8uvQkdLhfzytj6CwhAxsYD5VAhFmP6IQeREEZcWD0tFUlcQwzLqq/R8UBDsu5ilWkSKSdDLj7 l6x5k8IIbKFhL54J2wUsD8y3TrvBK22EEeO4K5NiGUpMAfq3UrcBNdgppsnw5zY/SHw2VevcGss5V 4cclNQfyHeS3VRi9xnxlrQ==; Date: Wed, 09 Aug 2023 16:21:46 +0300 Message-Id: <83pm3wl5at.fsf@gnu.org> From: Eli Zaretskii To: Sean Allred In-Reply-To: (message from Sean Allred on Wed, 09 Aug 2023 06:28:55 -0500) Subject: Re: bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory References: <83leemonyk.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65120 Cc: allred.sean@gmail.com, 65120@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Allred > Cc: Sean Allred , 65120@debbugs.gnu.org > Date: Wed, 09 Aug 2023 06:28:55 -0500 > > So, I'd like to shorten this $MegaCorpSource path using built-in > functionality where possible. My users aren't going to care about most > of the path components. I can roll my own, but is there something like > `abbreviate-file-name' that doesn't assume we're working with symlinks? > (Should/could there be? Thoughts on whether or not it is A Good > Idea(tm)?) I don't think there's something in Emacs. But you can use directory-abbrev-alist if you define a drive (using 'subst') that would remove the need for using the full file name. Something like subst x: C:\$MegaCorpSource Then you could use "x:/" in directory-abbrev-alist. This actually matches the "symlink" idea of this feature on Unix. (Yes, I know: corporate IT doesn't like SUBST very much, either. But maybe you will be lucky...) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 19:48:27 2023 Received: (at 65120) by debbugs.gnu.org; 9 Aug 2023 23:48:27 +0000 Received: from localhost ([127.0.0.1]:40675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTsug-00073G-L2 for submit@debbugs.gnu.org; Wed, 09 Aug 2023 19:48:27 -0400 Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]:38120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTsue-00072U-RN for 65120@debbugs.gnu.org; Wed, 09 Aug 2023 19:48:25 -0400 Received: by mail-yb1-xb2c.google.com with SMTP id 3f1490d57ef6-d3b03bcef86so64274276.0 for <65120@debbugs.gnu.org>; Wed, 09 Aug 2023 16:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691624899; x=1692229699; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=/Y2Xg9YwNNn9K61vvvr8OPPtSgMijnySKVQlm0HlKoY=; b=PiA7bSIH6wQWuFNYMA1kCfIjHCqkCkjN8PnhxPKtk6410M6xbmdPOLKZrzWIUES0/G S3IMyqMsUtsqX+AICSGZ6ifHANIEmoXphI44FBZGXJsYRjdZ6pawA4A7TeN1RLsP7Iwn 2dZUJvT7CavwbPXqV+B6xjXQuzR25i1nR5Td75YdU9V6H/8AhSfQm8ATV6XUD5xZHTJZ sAoN4d1VRZZpMpMfuR8poFsgcos4GFQjs4vEWHNFoo6dAAYsrm0f6gX2kru/8ZWiNauz Uh6bedKyogp3u18KyKVaCWHANIkvQLdRuWp0F3CnoukgXnb8uerdei/dd8aOysZGvcRX jKxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691624899; x=1692229699; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/Y2Xg9YwNNn9K61vvvr8OPPtSgMijnySKVQlm0HlKoY=; b=ijG+WXIsbIZOtSNFK7RpM0uGTB0TgdSxCWA9SVtVQXXVBQDLxl6BhBFA9ro2oq7qdn Tmz7OaYV7r0r2rbPJHf/TnvYtEbRC+IXWxVlc0c/0KUiO0J1xixSaLffoVAR7haLEFx9 ciQcM8Lc7ahfIrNNtUMhG+KOE7suswZN7SmVKZWdZ6pPV4qiuojyflkkmX0rjTJgyZsE xHwT5JE9/al5KJH11YfZVZQf/GUDMqPaysMMGacdFTCvtzTZNo8ccXytPGvr0HpHSR92 KEjWLwIlLFVC1tKY+/Z+EQuxxVFh9imAEPQLjxlQtbJsgoLW/kzTdCorlEWn9+Wy8VUN iBAw== X-Gm-Message-State: AOJu0Yy/oZHLURCH7x5kEiXgfW7mKIIdXqMBC9zCWMfTrgjuiI3E3sCH PsbWxuTLG4iIoL6LlJK4pz5/0TWSl8g= X-Google-Smtp-Source: AGHT+IGyke1W/FNVKExQ582vqPDVonrNNffEs7rp8pyu8vYPBpMfsl7W21edP6iEqRjSTcnQABM/XA== X-Received: by 2002:a81:49d4:0:b0:583:b3d2:ff9f with SMTP id w203-20020a8149d4000000b00583b3d2ff9fmr491887ywa.2.1691624899112; Wed, 09 Aug 2023 16:48:19 -0700 (PDT) Received: from epic96565.epic.com (097-091-065-227.res.spectrum.com. [97.91.65.227]) by smtp.gmail.com with ESMTPSA id x10-20020a0dd50a000000b0056d304e224dsm28293ywd.90.2023.08.09.16.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 16:48:18 -0700 (PDT) References: <83leemonyk.fsf@gnu.org> <83pm3wl5at.fsf@gnu.org> User-agent: mu4e 1.11.1; emacs 29.1 From: Sean Allred To: Eli Zaretskii Subject: Re: bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory Date: Wed, 09 Aug 2023 18:31:50 -0500 In-reply-to: <83pm3wl5at.fsf@gnu.org> Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65120 Cc: 65120@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > I don't think there's something in Emacs. But you can use > directory-abbrev-alist if you define a drive (using 'subst') that > would remove the need for using the full file name. Something like > > subst x: C:\$MegaCorpSource > > Then you could use "x:/" in directory-abbrev-alist. This actually > matches the "symlink" idea of this feature on Unix. Oh, neat! This is definitely not something I would make work 'out of the box' in my distribution, but I will absolutely add a note in my documentation to call out this strategy. We already have ~10ish mapped drives on the network -- as well as folks who use external drives. Would hate to clobber someone's environment. In the meantime, I think I'll create a new defcustom/defun pair: (defcustom directory-abbrev-display-alist nil "Like `directory-abbrev-alist', but for `abbreviate-file-name-for-display'.") (defun abbreviate-file-name-for-display (filename) "Like `abbreviate-file-name', but is not guaranteed to produce a functional path." (let ((directory-abbrev-alist (append directory-abbrev-display-alist directory-abbrev-alist))) (abbreviate-file-name filename))) ;; e.g. (let ((directory-abbrev-display-alist '(("C:/MegaCorpSource" . "@src")))) (abbreviate-file-name-for-display "C:/MegaCorpSource/foo")) => "@src/foo (Symbol names prefixed with my package prefix, of course.) If I get good mileage out of this, would this be the kind of thing I could submit a patch for? It turned out prettier than I was expecting. (I've already sorted out the FSF paperwork.) > (Yes, I know: corporate IT doesn't like SUBST very much, either. But > maybe you will be lucky...) Better to ask forgiveness... :-) [obligatory 'kidding' to any of my corporate IT friends who may be reading this post!] Thanks! -- Sean Allred From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 10 02:22:22 2023 Received: (at 65120) by debbugs.gnu.org; 10 Aug 2023 06:22:22 +0000 Received: from localhost ([127.0.0.1]:41117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTz3t-0001M6-PP for submit@debbugs.gnu.org; Thu, 10 Aug 2023 02:22:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTz3s-0001Lq-Er for 65120@debbugs.gnu.org; Thu, 10 Aug 2023 02:22:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTz3m-00051E-Tv; Thu, 10 Aug 2023 02:22:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+tlJyaWqWcOrQaa6gZV6sSW4Dw5hjQWhaTGyWf6eTwQ=; b=WL18IPUkxQ9P zbBmpFGoWD6zqhzCvHWoNFRLRx4hz9jTcGyE/xfyAbrAk1sZHZSHbsOyhmSZwzn7IL+IqJ2Wq4Sci AoQHjtxtUKpMfWi5e+bTIR1Ff2kPZAWYLiQcs+whbK5eCAz+IN1pWLsT1GYikT3xXlkYGqhIxcvuc 22zYmKK60nDn5MeMK4DzHljhH+/e+1SPdPL035tnI+Tzwiuxj5EYZQ2wb4n923jXPujr9ENlMnxuP FG/XrNlzIa2/ODZ5r2rSeVoFFyAmlUY2tiM82Lev4tZ+R9FwPBZfzFKlPXsIZTDvhfqycZX5X1jBZ PE86MtEo/TZwPCoBccGUrg==; Date: Thu, 10 Aug 2023 09:22:38 +0300 Message-Id: <83r0obju1d.fsf@gnu.org> From: Eli Zaretskii To: Sean Allred In-Reply-To: (message from Sean Allred on Wed, 09 Aug 2023 18:31:50 -0500) Subject: Re: bug#65120: 29.1; directory-abbrev-alist breaks various things when inside an abbreviated directory References: <83leemonyk.fsf@gnu.org> <83pm3wl5at.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65120 Cc: 65120@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Sean Allred > Cc: 65120@debbugs.gnu.org > Date: Wed, 09 Aug 2023 18:31:50 -0500 > > In the meantime, I think I'll create a new defcustom/defun pair: > > (defcustom directory-abbrev-display-alist > nil > "Like `directory-abbrev-alist', but for `abbreviate-file-name-for-display'.") > > (defun abbreviate-file-name-for-display (filename) > "Like `abbreviate-file-name', but is not guaranteed to produce a functional path." > (let ((directory-abbrev-alist (append directory-abbrev-display-alist > directory-abbrev-alist))) > (abbreviate-file-name filename))) > > ;; e.g. > (let ((directory-abbrev-display-alist > '(("C:/MegaCorpSource" . "@src")))) > (abbreviate-file-name-for-display "C:/MegaCorpSource/foo")) > => "@src/foo > > (Symbol names prefixed with my package prefix, of course.) > > If I get good mileage out of this, would this be the kind of thing I > could submit a patch for? It turned out prettier than I was expecting. > (I've already sorted out the FSF paperwork.) Where and how would this "abbreviated-for-display" file names used in Emacs?