From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: Reuben Thomas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jan 2011 21:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 7924@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129607803832570 (code B ref -1); Wed, 26 Jan 2011 21:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Jan 2011 21:40:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiD6S-0008TH-Rl for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:40:37 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiD6Q-0008T6-T2 for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:40:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiDEH-0001ed-JC for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:48:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:33695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiDEH-0001eZ-FE for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:48:41 -0500 Received: from [140.186.70.92] (port=50200 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiDEF-0004Sy-Pr for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 16:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiDED-0001e2-Ll for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 16:48:39 -0500 Received: from exprod7ob123.obsmtp.com ([64.18.2.23]:53282) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PiDED-0001dt-86 for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 16:48:37 -0500 Received: from source ([74.125.82.178]) (using TLSv1) by exprod7ob123.postini.com ([64.18.6.12]) with SMTP ID DSNKTUCWsaC2WcdrjP0YBbuJ+cgYWEVOyKSl@postini.com; Wed, 26 Jan 2011 13:48:35 PST Received: by wyb42 with SMTP id 42so1407981wyb.37 for ; Wed, 26 Jan 2011 13:48:32 -0800 (PST) Received: by 10.216.52.143 with SMTP id e15mr5772471wec.44.1296078511898; Wed, 26 Jan 2011 13:48:31 -0800 (PST) Received: from canta (87-194-87-241.bethere.co.uk [87.194.87.241]) by mx.google.com with ESMTPS id o33sm8029659wej.37.2011.01.26.13.48.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 13:48:31 -0800 (PST) From: Reuben Thomas Date: Wed, 26 Jan 2011 21:48:29 +0000 Message-ID: <87r5bz72vm.fsf@sc3d.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) Both in the manual and in the docstring for `cd', one might reasonably infer (as I did!) that CDPATH will be searched when completing relative directory names, but this is not the case. Is there in fact any way to get this to work? It=E2=80=99s something that o= ne can do nicely in bash in a terminal, for example, but not in shell-mode. In any case, it would be nice to lower users=E2=80=99 expectations by point= ing out in the docstring for cd, and in the manual, that it doesn=E2=80=99t app= ly to interactive completion. In GNU Emacs 23.2.91.4 (i686-pc-linux-gnu, GTK+ Version 2.22.0) of 2011-01-13 on canta Windowing system distributor `The X.Org Foundation', version 11.0.10900000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: shell-dirtrack-mode: t recentf-mode: t show-paren-mode: t savehist-mode: t minibuffer-electric-default-mode: t iswitchb-mode: t icomplete-mode: t global-whitespace-mode: t global-auto-revert-mode: t desktop-save-mode: t yas/global-mode: t yas/minor-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-b C-b C-b C-b C-b C-x 1 C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-s C D=20 P A T H C-a C-n C-n C-n C-n C-n C-h v c d - p a t h=20 C-x b M-x c d =20 =20 =20 g p r e =20 C-g C-x b * s h g r e p SPC c d - p=20 a t h S-SPC ~ ? . / . e m a=20 c s . d / * M-p . e l =20 M-p =20 =20 C D P A T H =20 M-p =20 =20 d e s e m=20 a c s . d / e e =20 s M-p =20 =20 =20 c d - p a t h c d SPC g r e p - c =20 d d e c o m p r e s s =20 M-> C-x b C-s r e=20 a d - C-a M-x r e p o r t - e m a c s - b u g Recent messages: No completions of ~/.des Type space to flush; repeat completion command to scroll No completions of ~/.emacs.dee Completing file name... No completions of ~/.emacs.dee Partially completed History item: 1 ~/repo/grep-decompress=20 Mark set Mark saved where search started Load-path shadows: /home/rrt/.emacs.d/elpa/ruby-mode-1.1/ruby-mode hides /usr/share/emacs-snap= shot/site-lisp/ruby1.8-elisp/ruby-mode /home/rrt/local/share/emacs/site-lisp/popup hides /usr/local/share/emacs/23= .2.91/site-lisp/auto-complete/popup /home/rrt/local/share/emacs/site-lisp/fuzzy hides /usr/local/share/emacs/23= .2.91/site-lisp/auto-complete/fuzzy /home/rrt/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/local/share/emacs/= 23.2.91/site-lisp/css-mode/css-mode /home/rrt/.emacs.d/elpa/dictionary-1.8.7/link hides /usr/local/share/emacs/= 23.2.91/site-lisp/dictionary-el/link /home/rrt/.emacs.d/elpa/dictionary-1.8.7/connection hides /usr/local/share/= emacs/23.2.91/site-lisp/dictionary-el/connection /home/rrt/.emacs.d/elpa/dictionary-1.8.7/dictionary-init hides /usr/local/s= hare/emacs/23.2.91/site-lisp/dictionary-el/dictionary-init /home/rrt/.emacs.d/elpa/dictionary-1.8.7/dictionary hides /usr/local/share/= emacs/23.2.91/site-lisp/dictionary-el/dictionary /home/rrt/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/local/share/emacs/= 23.2.91/lisp/textmodes/css-mode /home/rrt/.emacs.d/elpa/ruby-mode-1.1/ruby-mode hides /usr/local/share/emac= s/23.2.91/lisp/progmodes/ruby-mode /home/rrt/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/share/emacs/site-l= isp/css-mode/css-mode /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-info hides /usr/share/e= macs/site-lisp/auctex/tex-info /usr/local/share/emacs/23.2.91/site-lisp/auctex/context-nl hides /usr/share= /emacs/site-lisp/auctex/context-nl /usr/local/share/emacs/23.2.91/site-lisp/auctex/context-en hides /usr/share= /emacs/site-lisp/auctex/context-en /usr/local/share/emacs/23.2.91/site-lisp/auctex/latex hides /usr/share/emac= s/site-lisp/auctex/latex /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-mik hides /usr/share/em= acs/site-lisp/auctex/tex-mik /usr/local/share/emacs/23.2.91/site-lisp/dictionary-el/lpath hides /usr/sha= re/emacs/site-lisp/auctex/lpath /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-buf hides /usr/share/em= acs/site-lisp/auctex/tex-buf /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-jp hides /usr/share/ema= cs/site-lisp/auctex/tex-jp /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-bar hides /usr/share/em= acs/site-lisp/auctex/tex-bar /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex hides /usr/share/emacs/= site-lisp/auctex/tex /usr/local/share/emacs/23.2.91/site-lisp/auctex/multi-prompt hides /usr/sha= re/emacs/site-lisp/auctex/multi-prompt /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-fptex hides /usr/share/= emacs/site-lisp/auctex/tex-fptex /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-font hides /usr/share/e= macs/site-lisp/auctex/tex-font /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-fold hides /usr/share/e= macs/site-lisp/auctex/tex-fold /usr/local/share/emacs/23.2.91/site-lisp/auctex/texmathp hides /usr/share/e= macs/site-lisp/auctex/texmathp /usr/local/share/emacs/23.2.91/site-lisp/auctex/context hides /usr/share/em= acs/site-lisp/auctex/context /usr/local/share/emacs/23.2.91/site-lisp/auctex/font-latex hides /usr/share= /emacs/site-lisp/auctex/font-latex /usr/local/share/emacs/23.2.91/site-lisp/auctex/bib-cite hides /usr/share/e= macs/site-lisp/auctex/bib-cite /usr/local/share/emacs/23.2.91/site-lisp/auctex/toolbar-x hides /usr/share/= emacs/site-lisp/auctex/toolbar-x /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-style hides /usr/share/= emacs/site-lisp/auctex/tex-style Features: (shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils mailheader canlock sha1 hex-util hashcash mail-utils emacsbug multi-isearch find-func pp help-mode ansi-color shell gud jka-compr info m4-mode autoconf autoconf-mode view inform-mode noutline outline tex-info texinfo tex sh-script executable longlines make-mode vc-git face-remap filladapt flyspell completing-help recentf tree-widget wid-edit uniquify paren savehist minibuf-eldef iswitchb icomplete whitespace autorevert time cus-start cus-load desktop server php-mode etags cc-langs cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs speedbar sb-image ezimage dframe lua-mode regexp-opt comint ring ropemacs pymacs etags-update smart-quotes ispell auto-dictionary-autoloads css-mode-autoloads dictionary-autoloads diff-git-autoloads dired-isearch-autoloads full-ack-autoloads guess-style-autoloads http-post-simple-autoloads js2-mode-autoloads magit-autoloads mv-shell-autoloads ruby-mode-autoloads package reporter advice advice-preload yasnippet help-fns derived edmacro kmacro easymenu assoc cl cl-19 muse-autoloads emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode bbdb-autoloads preview-latex tex-site auto-loads tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) --=20 http://rrt.sc3d.org/ From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jan 2011 23:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Reuben Thomas Cc: 7924@debbugs.gnu.org Received: via spool by 7924-submit@debbugs.gnu.org id=B7924.12963432884325 (code B ref 7924); Sat, 29 Jan 2011 23:22:02 +0000 Received: (at 7924) by debbugs.gnu.org; 29 Jan 2011 23:21:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjK6h-00017i-DD for submit@debbugs.gnu.org; Sat, 29 Jan 2011 18:21:27 -0500 Received: from vm-emlprdomr-04.its.yale.edu ([130.132.50.145]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjK6g-00017Y-G1 for 7924@debbugs.gnu.org; Sat, 29 Jan 2011 18:21:26 -0500 Received: from furball (dhcp128036226053.central.yale.edu [128.36.226.53]) (authenticated bits=0) by vm-emlprdomr-04.its.yale.edu (8.14.4/8.14.4) with ESMTP id p0TNTfrY020605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 29 Jan 2011 18:29:42 -0500 Received: by furball (Postfix, from userid 1000) id BAA471603EB; Sat, 29 Jan 2011 18:29:41 -0500 (EST) From: Chong Yidong References: <87r5bz72vm.fsf@sc3d.org> Date: Sat, 29 Jan 2011 18:29:41 -0500 In-Reply-To: <87r5bz72vm.fsf@sc3d.org> (Reuben Thomas's message of "Wed, 26 Jan 2011 21:48:29 +0000") Message-ID: <87k4hnp9ui.fsf@stupidchicken.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.71 on 130.132.50.145 X-Spam-Score: -2.7 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) Reuben Thomas writes: > Both in the manual and in the docstring for `cd', one might reasonably > infer (as I did!) that CDPATH will be searched when completing relative > directory names, but this is not the case. > > Is there in fact any way to get this to work? It=E2=80=99s something that= one > can do nicely in bash in a terminal, for example, but not in shell-mode. I think this needs new code in `read-file-name-internal' (the completion function for read-file-name). From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: Reuben Thomas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jan 2011 13:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chong Yidong Cc: 7924@debbugs.gnu.org Received: via spool by 7924-submit@debbugs.gnu.org id=B7924.129639397116105 (code B ref 7924); Sun, 30 Jan 2011 13:27:01 +0000 Received: (at 7924) by debbugs.gnu.org; 30 Jan 2011 13:26:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjXIA-0004Bi-GA for submit@debbugs.gnu.org; Sun, 30 Jan 2011 08:26:10 -0500 Received: from exprod7og121.obsmtp.com ([64.18.2.20]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PjXI9-0004BW-4k for 7924@debbugs.gnu.org; Sun, 30 Jan 2011 08:26:09 -0500 Received: from source ([209.85.218.41]) (using TLSv1) by exprod7ob121.postini.com ([64.18.6.12]) with SMTP ID DSNKTUVo4ner3S3lAZ99chwzeWbz8FRDZ/+o@postini.com; Sun, 30 Jan 2011 05:34:32 PST Received: by yia25 with SMTP id 25so1686066yia.28 for <7924@debbugs.gnu.org>; Sun, 30 Jan 2011 05:34:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.150.203.8 with SMTP id a8mr6772432ybg.136.1296394464991; Sun, 30 Jan 2011 05:34:24 -0800 (PST) Received: by 10.151.102.11 with HTTP; Sun, 30 Jan 2011 05:34:24 -0800 (PST) In-Reply-To: <87k4hnp9ui.fsf@stupidchicken.com> References: <87r5bz72vm.fsf@sc3d.org> <87k4hnp9ui.fsf@stupidchicken.com> Date: Sun, 30 Jan 2011 13:34:24 +0000 Message-ID: From: Reuben Thomas Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) On 29 January 2011 23:29, Chong Yidong wrote: > Reuben Thomas writes: > >> Both in the manual and in the docstring for `cd', one might reasonably >> infer (as I did!) that CDPATH will be searched when completing relative >> directory names, but this is not the case. >> >> Is there in fact any way to get this to work? It=92s something that one >> can do nicely in bash in a terminal, for example, but not in shell-mode. > > I think this needs new code in `read-file-name-internal' (the completion > function for read-file-name). Fair enough, but in that case is it worth adding "(this does not work with filename completion)" to the docstring and manual? --=20 http://rrt.sc3d.org From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Jan 2011 04:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chong Yidong Cc: 7924@debbugs.gnu.org, Reuben Thomas Received: via spool by 7924-submit@debbugs.gnu.org id=B7924.129644649224394 (code B ref 7924); Mon, 31 Jan 2011 04:02:02 +0000 Received: (at 7924) by debbugs.gnu.org; 31 Jan 2011 04:01:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjkxI-0006LP-2w for submit@debbugs.gnu.org; Sun, 30 Jan 2011 23:01:32 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjkxG-0006LB-1s for 7924@debbugs.gnu.org; Sun, 30 Jan 2011 23:01:30 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG7ERU1MCpTp/2dsb2JhbACEFaBfdKlXj0OBI4M3dASFE49o X-IronPort-AV: E=Sophos;i="4.60,402,1291611600"; d="scan'208";a="89881870" Received: from 76-10-148-233.dsl.teksavvy.com (HELO ceviche.home) ([76.10.148.233]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 30 Jan 2011 23:09:49 -0500 Received: by ceviche.home (Postfix, from userid 20848) id C4F4E660DC; Sun, 30 Jan 2011 23:09:48 -0500 (EST) From: Stefan Monnier Message-ID: References: <87r5bz72vm.fsf@sc3d.org> <87k4hnp9ui.fsf@stupidchicken.com> Date: Sun, 30 Jan 2011 23:09:48 -0500 In-Reply-To: <87k4hnp9ui.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 29 Jan 2011 18:29:41 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >> Both in the manual and in the docstring for `cd', one might reasonably >> infer (as I did!) that CDPATH will be searched when completing relative >> directory names, but this is not the case. >>=20 >> Is there in fact any way to get this to work? It=E2=80=99s something tha= t one >> can do nicely in bash in a terminal, for example, but not in shell-mode. > I think this needs new code in `read-file-name-internal' (the completion > function for read-file-name). Indeed, but only for `cd'. It shouldn't be too hard to do it either, Stefan From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Feb 2011 22:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Chong Yidong Cc: 7924@debbugs.gnu.org, Reuben Thomas Received: via spool by 7924-submit@debbugs.gnu.org id=B7924.12965978132848 (code B ref 7924); Tue, 01 Feb 2011 22:04:02 +0000 Received: (at 7924) by debbugs.gnu.org; 1 Feb 2011 22:03:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkOJw-0000js-Ma for submit@debbugs.gnu.org; Tue, 01 Feb 2011 17:03:33 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkOJu-0000jf-97 for 7924@debbugs.gnu.org; Tue, 01 Feb 2011 17:03:31 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p11MCOmA001250; Tue, 1 Feb 2011 17:12:24 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 7860C1300EB; Tue, 1 Feb 2011 17:11:52 -0500 (EST) From: Stefan Monnier Message-ID: References: <87r5bz72vm.fsf@sc3d.org> <87k4hnp9ui.fsf@stupidchicken.com> Date: Tue, 01 Feb 2011 17:11:52 -0500 In-Reply-To: <87k4hnp9ui.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 29 Jan 2011 18:29:41 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3735=0 X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) >> Both in the manual and in the docstring for `cd', one might reasonably >> infer (as I did!) that CDPATH will be searched when completing relative >> directory names, but this is not the case. >>=20 >> Is there in fact any way to get this to work? It=E2=80=99s something tha= t one >> can do nicely in bash in a terminal, for example, but not in shell-mode. > I think this needs new code in `read-file-name-internal' (the completion > function for read-file-name). The patch below seems to work in my brief testing. Stefan =3D=3D=3D modified file 'lisp/files.el' --- lisp/files.el 2011-02-01 20:53:09 +0000 +++ lisp/files.el 2011-02-01 22:06:43 +0000 @@ -700,25 +700,36 @@ `path-separator') when resolving a relative directory name. The path separator is colon in GNU and GNU-like systems." (interactive - (list (read-directory-name "Change default directory: " + (list + ;; FIXME: There's a subtle bug in the completion below. Seems linked + ;; to a fundamental difficulty of implementing `predicate' correctly. + ;; The manifestation is that TAB may list non-directories in the case = where + ;; those files also correspond to valid directories (if your cd-path i= s (A/ + ;; B/) and you have A/a a file and B/a a directory, then both `a' and = `a/' + ;; will be listed as valid completions). + ;; This is because `a' (listed because of A/a) is indeed a valid choice + ;; (which will lead to the use of B/a). + (minibuffer-with-setup-hook + (lambda () + (setq minibuffer-completion-table + (apply-partially #'locate-file-completion-table + cd-path nil)) + (setq minibuffer-completion-predicate + (lambda (dir) + (locate-file dir cd-path nil + (lambda (f) (and (file-directory-p f) 'dir-= ok)))))) + (unless cd-path + (setq cd-path (or (parse-colon-path (getenv "CDPATH")) + (list "./")))) + (read-directory-name "Change default directory: " default-directory default-directory - (and (member cd-path '(nil ("./"))) - (null (getenv "CDPATH")))))) - (if (file-name-absolute-p dir) - (cd-absolute (expand-file-name dir)) - (if (null cd-path) - (let ((trypath (parse-colon-path (getenv "CDPATH")))) - (setq cd-path (or trypath (list "./"))))) - (if (not (catch 'found - (mapc - (function (lambda (x) - (let ((f (expand-file-name (concat x dir)))) - (if (file-directory-p f) - (progn - (cd-absolute f) - (throw 'found t)))))) - cd-path) - nil)) + t)))) + (unless cd-path + (setq cd-path (or (parse-colon-path (getenv "CDPATH")) + (list "./")))) + (cd-absolute + (or (locate-file dir cd-path nil + (lambda (f) (and (file-directory-p f) 'dir-ok))) (error "No such directory found via CDPATH environment variable")))) =20 (defun load-file (file) =3D=3D=3D modified file 'src/lread.c' --- src/lread.c 2011-01-31 18:47:03 +0000 +++ src/lread.c 2011-02-01 21:57:03 +0000 @@ -1223,7 +1223,9 @@ file name when searching. If non-nil, PREDICATE is used instead of `file-readable-p'. PREDICATE can also be an integer to pass to the access(2) function, -in which case file-name-handlers are ignored. */) +in which case file-name-handlers are ignored. +This function will normally skip directories, so if you want it to find +directories, make sure the PREDICATE function return `dir-ok' for them. *= /) (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Obje= ct predicate) { Lisp_Object file; @@ -1233,6 +1235,7 @@ return file; } =20 +static Lisp_Object Qdir_ok; =20 /* Search for a file whose name is STR, looking in directories in the Lisp list PATH, and trying suffixes from SUFFIX. @@ -1350,9 +1353,12 @@ if (NILP (predicate)) exists =3D !NILP (Ffile_readable_p (string)); else - exists =3D !NILP (call1 (predicate, string)); - if (exists && !NILP (Ffile_directory_p (string))) - exists =3D 0; + { + Lisp_Object tmp =3D call1 (predicate, string); + exists =3D !NILP (tmp) + && (EQ (tmp, Qdir_ok) + || !NILP (Ffile_directory_p (string))); + } =20 if (exists) { @@ -4369,6 +4375,9 @@ Qfile_truename =3D intern_c_string ("file-truename"); staticpro (&Qfile_truename) ; =20 + Qdir_ok =3D intern_c_string ("dir-ok"); + staticpro (&Qdir_ok); +=20=20 Qdo_after_load_evaluation =3D intern_c_string ("do-after-load-evaluation= "); staticpro (&Qdo_after_load_evaluation) ; =20 From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: Reuben Thomas Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Feb 2011 11:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 7924@debbugs.gnu.org, Chong Yidong Received: via spool by 7924-submit@debbugs.gnu.org id=B7924.129673278913490 (code B ref 7924); Thu, 03 Feb 2011 11:34:01 +0000 Received: (at 7924) by debbugs.gnu.org; 3 Feb 2011 11:33:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkxQz-0003VV-7k for submit@debbugs.gnu.org; Thu, 03 Feb 2011 06:33:09 -0500 Received: from exprod7og109.obsmtp.com ([64.18.2.171]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PkxQw-0003V2-6J for 7924@debbugs.gnu.org; Thu, 03 Feb 2011 06:33:07 -0500 Received: from source ([209.85.218.54]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKTUqUbWZFHeVIzyHLaHF/szWeOp1s7HS+@postini.com; Thu, 03 Feb 2011 03:41:39 PST Received: by yie19 with SMTP id 19so459320yie.41 for <7924@debbugs.gnu.org>; Thu, 03 Feb 2011 03:41:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.151.45.12 with SMTP id x12mr84831ybj.307.1296733292517; Thu, 03 Feb 2011 03:41:32 -0800 (PST) Received: by 10.151.102.11 with HTTP; Thu, 3 Feb 2011 03:41:32 -0800 (PST) In-Reply-To: References: <87r5bz72vm.fsf@sc3d.org> <87k4hnp9ui.fsf@stupidchicken.com> Date: Thu, 3 Feb 2011 11:41:32 +0000 Message-ID: From: Reuben Thomas Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Thanks very much for this Stefan. Unfortunately I can't get emacs head to build at the moment, and the patch doesn't apply to the emacs-23 branch. From unknown Sun Aug 17 10:17:17 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Reuben Thomas Subject: bug#7924: closed (Re: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading) Message-ID: References: <87r5bz72vm.fsf@sc3d.org> X-Gnu-PR-Message: they-closed 7924 X-Gnu-PR-Package: emacs Reply-To: 7924@debbugs.gnu.org Date: Fri, 18 Feb 2011 17:28:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1298050083-3507-1" This is a multi-part message in MIME format... ------------=_1298050083-3507-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #7924: 23.2.91; Documentation about CDPATH is a little misleading which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 7924@debbugs.gnu.org. --=20 7924: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7924 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1298050083-3507-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 7924-done) by debbugs.gnu.org; 18 Feb 2011 17:28:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PqU7c-0000uN-GC for submit@debbugs.gnu.org; Fri, 18 Feb 2011 12:28:00 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PqU7b-0000uC-CX for 7924-done@debbugs.gnu.org; Fri, 18 Feb 2011 12:27:59 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p1IHRrh6023329; Fri, 18 Feb 2011 12:27:53 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id B2D0EB411A; Fri, 18 Feb 2011 12:27:52 -0500 (EST) From: Stefan Monnier To: Reuben Thomas Subject: Re: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Message-ID: References: <87r5bz72vm.fsf@sc3d.org> <87k4hnp9ui.fsf@stupidchicken.com> Date: Fri, 18 Feb 2011 12:27:52 -0500 In-Reply-To: (Reuben Thomas's message of "Thu, 3 Feb 2011 11:41:32 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3735=0 X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 7924-done Cc: 7924-done@debbugs.gnu.org, Chong Yidong X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Thanks very much for this Stefan. Unfortunately I can't get Emacs's head > to build at the moment, and the patch doesn't apply to the emacs-23 > branch. I've installed it to the trunk, thanks. Stefan ------------=_1298050083-3507-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Jan 2011 21:40:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiD6S-0008TH-Rl for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:40:37 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PiD6Q-0008T6-T2 for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:40:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiDEH-0001ed-JC for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:48:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:33695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiDEH-0001eZ-FE for submit@debbugs.gnu.org; Wed, 26 Jan 2011 16:48:41 -0500 Received: from [140.186.70.92] (port=50200 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiDEF-0004Sy-Pr for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 16:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiDED-0001e2-Ll for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 16:48:39 -0500 Received: from exprod7ob123.obsmtp.com ([64.18.2.23]:53282) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PiDED-0001dt-86 for bug-gnu-emacs@gnu.org; Wed, 26 Jan 2011 16:48:37 -0500 Received: from source ([74.125.82.178]) (using TLSv1) by exprod7ob123.postini.com ([64.18.6.12]) with SMTP ID DSNKTUCWsaC2WcdrjP0YBbuJ+cgYWEVOyKSl@postini.com; Wed, 26 Jan 2011 13:48:35 PST Received: by wyb42 with SMTP id 42so1407981wyb.37 for ; Wed, 26 Jan 2011 13:48:32 -0800 (PST) Received: by 10.216.52.143 with SMTP id e15mr5772471wec.44.1296078511898; Wed, 26 Jan 2011 13:48:31 -0800 (PST) Received: from canta (87-194-87-241.bethere.co.uk [87.194.87.241]) by mx.google.com with ESMTPS id o33sm8029659wej.37.2011.01.26.13.48.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 13:48:31 -0800 (PST) From: Reuben Thomas To: bug-gnu-emacs@gnu.org Subject: 23.2.91; Documentation about CDPATH is a little misleading Date: Wed, 26 Jan 2011 21:48:29 +0000 Message-ID: <87r5bz72vm.fsf@sc3d.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) Both in the manual and in the docstring for `cd', one might reasonably infer (as I did!) that CDPATH will be searched when completing relative directory names, but this is not the case. Is there in fact any way to get this to work? It=E2=80=99s something that o= ne can do nicely in bash in a terminal, for example, but not in shell-mode. In any case, it would be nice to lower users=E2=80=99 expectations by point= ing out in the docstring for cd, and in the manual, that it doesn=E2=80=99t app= ly to interactive completion. In GNU Emacs 23.2.91.4 (i686-pc-linux-gnu, GTK+ Version 2.22.0) of 2011-01-13 on canta Windowing system distributor `The X.Org Foundation', version 11.0.10900000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: shell-dirtrack-mode: t recentf-mode: t show-paren-mode: t savehist-mode: t minibuffer-electric-default-mode: t iswitchb-mode: t icomplete-mode: t global-whitespace-mode: t global-auto-revert-mode: t desktop-save-mode: t yas/global-mode: t yas/minor-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-b C-b C-b C-b C-b C-x 1 C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-n C-s C D=20 P A T H C-a C-n C-n C-n C-n C-n C-h v c d - p a t h=20 C-x b M-x c d =20 =20 =20 g p r e =20 C-g C-x b * s h g r e p SPC c d - p=20 a t h S-SPC ~ ? . / . e m a=20 c s . d / * M-p . e l =20 M-p =20 =20 C D P A T H =20 M-p =20 =20 d e s e m=20 a c s . d / e e =20 s M-p =20 =20 =20 c d - p a t h c d SPC g r e p - c =20 d d e c o m p r e s s =20 M-> C-x b C-s r e=20 a d - C-a M-x r e p o r t - e m a c s - b u g Recent messages: No completions of ~/.des Type space to flush; repeat completion command to scroll No completions of ~/.emacs.dee Completing file name... No completions of ~/.emacs.dee Partially completed History item: 1 ~/repo/grep-decompress=20 Mark set Mark saved where search started Load-path shadows: /home/rrt/.emacs.d/elpa/ruby-mode-1.1/ruby-mode hides /usr/share/emacs-snap= shot/site-lisp/ruby1.8-elisp/ruby-mode /home/rrt/local/share/emacs/site-lisp/popup hides /usr/local/share/emacs/23= .2.91/site-lisp/auto-complete/popup /home/rrt/local/share/emacs/site-lisp/fuzzy hides /usr/local/share/emacs/23= .2.91/site-lisp/auto-complete/fuzzy /home/rrt/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/local/share/emacs/= 23.2.91/site-lisp/css-mode/css-mode /home/rrt/.emacs.d/elpa/dictionary-1.8.7/link hides /usr/local/share/emacs/= 23.2.91/site-lisp/dictionary-el/link /home/rrt/.emacs.d/elpa/dictionary-1.8.7/connection hides /usr/local/share/= emacs/23.2.91/site-lisp/dictionary-el/connection /home/rrt/.emacs.d/elpa/dictionary-1.8.7/dictionary-init hides /usr/local/s= hare/emacs/23.2.91/site-lisp/dictionary-el/dictionary-init /home/rrt/.emacs.d/elpa/dictionary-1.8.7/dictionary hides /usr/local/share/= emacs/23.2.91/site-lisp/dictionary-el/dictionary /home/rrt/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/local/share/emacs/= 23.2.91/lisp/textmodes/css-mode /home/rrt/.emacs.d/elpa/ruby-mode-1.1/ruby-mode hides /usr/local/share/emac= s/23.2.91/lisp/progmodes/ruby-mode /home/rrt/.emacs.d/elpa/css-mode-1.0/css-mode hides /usr/share/emacs/site-l= isp/css-mode/css-mode /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-info hides /usr/share/e= macs/site-lisp/auctex/tex-info /usr/local/share/emacs/23.2.91/site-lisp/auctex/context-nl hides /usr/share= /emacs/site-lisp/auctex/context-nl /usr/local/share/emacs/23.2.91/site-lisp/auctex/context-en hides /usr/share= /emacs/site-lisp/auctex/context-en /usr/local/share/emacs/23.2.91/site-lisp/auctex/latex hides /usr/share/emac= s/site-lisp/auctex/latex /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-mik hides /usr/share/em= acs/site-lisp/auctex/tex-mik /usr/local/share/emacs/23.2.91/site-lisp/dictionary-el/lpath hides /usr/sha= re/emacs/site-lisp/auctex/lpath /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-buf hides /usr/share/em= acs/site-lisp/auctex/tex-buf /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-jp hides /usr/share/ema= cs/site-lisp/auctex/tex-jp /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-bar hides /usr/share/em= acs/site-lisp/auctex/tex-bar /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex hides /usr/share/emacs/= site-lisp/auctex/tex /usr/local/share/emacs/23.2.91/site-lisp/auctex/multi-prompt hides /usr/sha= re/emacs/site-lisp/auctex/multi-prompt /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-fptex hides /usr/share/= emacs/site-lisp/auctex/tex-fptex /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-font hides /usr/share/e= macs/site-lisp/auctex/tex-font /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-fold hides /usr/share/e= macs/site-lisp/auctex/tex-fold /usr/local/share/emacs/23.2.91/site-lisp/auctex/texmathp hides /usr/share/e= macs/site-lisp/auctex/texmathp /usr/local/share/emacs/23.2.91/site-lisp/auctex/context hides /usr/share/em= acs/site-lisp/auctex/context /usr/local/share/emacs/23.2.91/site-lisp/auctex/font-latex hides /usr/share= /emacs/site-lisp/auctex/font-latex /usr/local/share/emacs/23.2.91/site-lisp/auctex/bib-cite hides /usr/share/e= macs/site-lisp/auctex/bib-cite /usr/local/share/emacs/23.2.91/site-lisp/auctex/toolbar-x hides /usr/share/= emacs/site-lisp/auctex/toolbar-x /usr/local/share/emacs/23.2.91/site-lisp/auctex/tex-style hides /usr/share/= emacs/site-lisp/auctex/tex-style Features: (shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils mailheader canlock sha1 hex-util hashcash mail-utils emacsbug multi-isearch find-func pp help-mode ansi-color shell gud jka-compr info m4-mode autoconf autoconf-mode view inform-mode noutline outline tex-info texinfo tex sh-script executable longlines make-mode vc-git face-remap filladapt flyspell completing-help recentf tree-widget wid-edit uniquify paren savehist minibuf-eldef iswitchb icomplete whitespace autorevert time cus-start cus-load desktop server php-mode etags cc-langs cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs speedbar sb-image ezimage dframe lua-mode regexp-opt comint ring ropemacs pymacs etags-update smart-quotes ispell auto-dictionary-autoloads css-mode-autoloads dictionary-autoloads diff-git-autoloads dired-isearch-autoloads full-ack-autoloads guess-style-autoloads http-post-simple-autoloads js2-mode-autoloads magit-autoloads mv-shell-autoloads ruby-mode-autoloads package reporter advice advice-preload yasnippet help-fns derived edmacro kmacro easymenu assoc cl cl-19 muse-autoloads emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode bbdb-autoloads preview-latex tex-site auto-loads tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) --=20 http://rrt.sc3d.org/ ------------=_1298050083-3507-1-- From unknown Sun Aug 17 10:17:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7924: 23.2.91; Documentation about CDPATH is a little misleading Resent-From: "Andrew W. Nosenko" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Feb 2011 11:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7924 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 7924@debbugs.gnu.org, Chong Yidong , Reuben Thomas Received: via spool by 7924-submit@debbugs.gnu.org id=B7924.129837392530846 (code B ref 7924); Tue, 22 Feb 2011 11:26:02 +0000 Received: (at 7924) by debbugs.gnu.org; 22 Feb 2011 11:25:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrqMu-00081T-Oh for submit@debbugs.gnu.org; Tue, 22 Feb 2011 06:25:25 -0500 Received: from mail-qw0-f44.google.com ([209.85.216.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PrqMs-00081D-OZ for 7924@debbugs.gnu.org; Tue, 22 Feb 2011 06:25:23 -0500 Received: by qwh6 with SMTP id 6so1113748qwh.3 for <7924@debbugs.gnu.org>; Tue, 22 Feb 2011 03:25:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RgkJsiWGbJJK0rYgSohbnmELVeekiyKZDnBsdQ6NtJ0=; b=J8BMQJAENOXoMEru2rcAFx7K+rVkLmyEueR2fDNRqlOz3D0SeIlEpBOQn97mD94DMV Ag48meLkSLvecNwr0WbA6TeOhF9OM74I/9lXKIW3NlXIlPyBy5x2ycTfXmzbs/SocVe7 h4SRuVMn17jxUafFQ6KTEFfbS8tTIa3yUr8HE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=GXAlCMZj1htF9hIhzN7R1Jn0FHHtobCNGEm4CE/yeNGcAHXIDvnuyb2xL7M234cR+O ql5vJO7tChzIYVeO+4CmAnim6ePCRUGmkHg2SAAJQ7J0Jmij8kYp6GbhIBwIfxV/ios1 1wkL1mScZMjP3SPzESlpEyF0EJDEaJ4PkUbTI= MIME-Version: 1.0 Received: by 10.229.229.209 with SMTP id jj17mr1843839qcb.273.1298373917026; Tue, 22 Feb 2011 03:25:17 -0800 (PST) Received: by 10.229.105.155 with HTTP; Tue, 22 Feb 2011 03:25:16 -0800 (PST) In-Reply-To: References: <87r5bz72vm.fsf@sc3d.org> <87k4hnp9ui.fsf@stupidchicken.com> Date: Tue, 22 Feb 2011 13:25:16 +0200 Message-ID: From: "Andrew W. Nosenko" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) On Wed, Feb 2, 2011 at 00:11, Stefan Monnier wro= te: >>> Both in the manual and in the docstring for `cd', one might reasonably >>> infer (as I did!) that CDPATH will be searched when completing relative >>> directory names, but this is not the case. >>> >>> Is there in fact any way to get this to work? It=92s something that one >>> can do nicely in bash in a terminal, for example, but not in shell-mode= . > >> I think this needs new code in `read-file-name-internal' (the completion >> function for read-file-name). > > The patch below seems to work in my brief testing. > > > =A0 =A0 =A0 =A0Stefan > > > =3D=3D=3D modified file 'lisp/files.el' > --- lisp/files.el =A0 =A0 =A0 2011-02-01 20:53:09 +0000 > +++ lisp/files.el =A0 =A0 =A0 2011-02-01 22:06:43 +0000 > @@ -700,25 +700,36 @@ > =A0`path-separator') when resolving a relative directory name. > =A0The path separator is colon in GNU and GNU-like systems." > =A0 (interactive > - =A0 (list (read-directory-name "Change default directory: " > + =A0 (list > + =A0 =A0;; FIXME: There's a subtle bug in the completion below. =A0Seems= linked > + =A0 =A0;; to a fundamental difficulty of implementing `predicate' corre= ctly. > + =A0 =A0;; The manifestation is that TAB may list non-directories in the= case where > + =A0 =A0;; those files also correspond to valid directories (if your cd-= path is (A/ > + =A0 =A0;; B/) and you have A/a a file and B/a a directory, then both `a= ' and `a/' > + =A0 =A0;; will be listed as valid completions). > + =A0 =A0;; This is because `a' (listed because of A/a) is indeed a valid= choice > + =A0 =A0;; (which will lead to the use of B/a). > + =A0 =A0(minibuffer-with-setup-hook > + =A0 =A0 =A0 =A0(lambda () > + =A0 =A0 =A0 =A0 =A0(setq minibuffer-completion-table > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(apply-partially #'locate-file-completio= n-table > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cd-path= nil)) > + =A0 =A0 =A0 =A0 =A0(setq minibuffer-completion-predicate > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(lambda (dir) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(locate-file dir cd-path nil > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (lambda (f)= (and (file-directory-p f) 'dir-ok)))))) > + =A0 =A0 =A0(unless cd-path > + =A0 =A0 =A0 =A0(setq cd-path (or (parse-colon-path (getenv "CDPATH")) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(list "./")))) > + =A0 =A0 =A0(read-directory-name "Change default directory: " > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 default-directory default= -directory > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(and (member cd-path '(n= il ("./"))) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (null (getenv "= CDPATH")))))) > - =A0(if (file-name-absolute-p dir) > - =A0 =A0 =A0(cd-absolute (expand-file-name dir)) > - =A0 =A0(if (null cd-path) > - =A0 =A0 =A0 (let ((trypath (parse-colon-path (getenv "CDPATH")))) > - =A0 =A0 =A0 =A0 (setq cd-path (or trypath (list "./"))))) > - =A0 =A0(if (not (catch 'found > - =A0 =A0 =A0 =A0 =A0 =A0 =A0(mapc > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 (function (lambda (x) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (let ((f (expand-fi= le-name (concat x dir)))) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if (file-direc= tory-p f) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (progn > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (cd= -absolute f) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (th= row 'found t)))))) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 cd-path) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0nil)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 t)))) > + =A0(unless cd-path > + =A0 =A0(setq cd-path (or (parse-colon-path (getenv "CDPATH")) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(list "./")))) > + =A0(cd-absolute > + =A0 (or (locate-file dir cd-path nil > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(lambda (f) (and (file-directory= -p f) 'dir-ok))) > =A0 =A0 =A0 =A0(error "No such directory found via CDPATH environment var= iable")))) > > =A0(defun load-file (file) > > =3D=3D=3D modified file 'src/lread.c' > --- src/lread.c 2011-01-31 18:47:03 +0000 > +++ src/lread.c 2011-02-01 21:57:03 +0000 > @@ -1223,7 +1223,9 @@ > =A0file name when searching. > =A0If non-nil, PREDICATE is used instead of `file-readable-p'. > =A0PREDICATE can also be an integer to pass to the access(2) function, > -in which case file-name-handlers are ignored. =A0*/) > +in which case file-name-handlers are ignored. > +This function will normally skip directories, so if you want it to find > +directories, make sure the PREDICATE function return `dir-ok' for them. = =A0*/) > =A0 (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_O= bject predicate) > =A0{ > =A0 Lisp_Object file; > @@ -1233,6 +1235,7 @@ > =A0 return file; > =A0} > > +static Lisp_Object Qdir_ok; > > =A0/* Search for a file whose name is STR, looking in directories > =A0 =A0in the Lisp list PATH, and trying suffixes from SUFFIX. > @@ -1350,9 +1353,12 @@ > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (NILP (predicate)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0exists =3D !NILP (Ffile_readable_p (string= )); > =A0 =A0 =A0 =A0 =A0 =A0 =A0else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 exists =3D !NILP (call1 (predicate, string)= ); > - =A0 =A0 =A0 =A0 =A0 =A0 if (exists && !NILP (Ffile_directory_p (string)= )) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 exists =3D 0; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Lisp_Object tmp =3D call1 (predicate, s= tring); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 exists =3D !NILP (tmp) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && (EQ (tmp, Qdir_ok) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 || !NILP (Ffile_directory_p= (string))); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (exists) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > @@ -4369,6 +4375,9 @@ > =A0 Qfile_truename =3D intern_c_string ("file-truename"); > =A0 staticpro (&Qfile_truename) ; > > + =A0Qdir_ok =3D intern_c_string ("dir-ok"); > + =A0staticpro (&Qdir_ok); > + > =A0 Qdo_after_load_evaluation =3D intern_c_string ("do-after-load-evaluat= ion"); > =A0 staticpro (&Qdo_after_load_evaluation) ; > This patch breaks spell checking. Now ispell-word unable to find installed aspell, tries to use ispell (as fallback?) and fails because ispell is absent indeed. Starting new Ispell process [default] ... apply: Searching for program: no such file or directory, ispell --=20 Andrew W. Nosenko