From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Steven W. Orr" Newsgroups: gmane.emacs.help Subject: Looking for CDPATH functionality in emacs. Date: Mon, 03 Jan 2011 13:55:01 -0500 Organization: SysLang Message-ID: <4D221B85.5040702@syslang.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig243A29FE3AC749810FF3F77A" X-Trace: dough.gmane.org 1294080942 14906 80.91.229.12 (3 Jan 2011 18:55:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 Jan 2011 18:55:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 03 19:55:38 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PZpZ9-0001bW-Tl for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Jan 2011 19:55:36 +0100 Original-Received: from localhost ([127.0.0.1]:34580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZpZ9-0002B4-Fy for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Jan 2011 13:55:35 -0500 Original-Received: from [140.186.70.92] (port=38457 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZpYn-0002Ap-EU for help-gnu-emacs@gnu.org; Mon, 03 Jan 2011 13:55:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZpYm-0004rB-2k for help-gnu-emacs@gnu.org; Mon, 03 Jan 2011 13:55:13 -0500 Original-Received: from saturn.syslang.net ([207.172.210.41]:49639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZpYl-0004ow-Vq for help-gnu-emacs@gnu.org; Mon, 03 Jan 2011 13:55:12 -0500 Original-Received: from saturn.syslang.net (localhost.localdomain [127.0.0.1]) by saturn.syslang.net (8.14.3/8.14.3) with ESMTP id p03It8j0032059 for ; Mon, 3 Jan 2011 13:55:10 -0500 User-Agent: Thunderbird 2.0.0.23 (X11/20090825) X-Enigmail-Version: 0.96.0 OpenPGP: id=F0BE3724; url=http://steveo.syslang.net/steveo-pubkey.asc X-GPG-PUBLIC_KEY: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF0BE3724 X-GPG-FINGRPRINT: 5E2A 0119 8E98 730A 87DF 205C 4485 72E1 F0BE 3724 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78122 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig243A29FE3AC749810FF3F77A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This is a bit long, so all I can do is apologise. I have a number of directories that I use frequently. From the bash side = of things I set the CDPATH variable in bash to :d1:d2:d3 and then I can just= go to places inside d[123] and it just works. I also have the bash variable cdable_vars set to allow me to say d4=3D/path/to/d4 followed by cd d4 and it all works peachy keen. What I'd like to do in emacs is to be able to visit a file in some direct= ory that I favor (somehow) so that it will automagically find it without havi= ng to slog through the whole path to get there. I did find file-cache-find-directory which looks like it's half of what I= want. But that has two problems: 1. I added this to my .emacs (file-cache-add-directory "/path/to/special/dir") I saw no special behavior when I ran this, either from my .emacs or inter= actively. 2. I normally visit files using my own my-visit-file function: (defun my-visit-file (arg) "Visit a file using completion. If there is only one window with nothing in it, then do not split the current window. " (interactive "Fmy-visit-file :") (if (and (one-window-p) (zerop (buffer-size))) (find-file arg t) (find-file-other-window arg t))) I use this function so that if I visit a file from an empty buffer, I won= 't end up with two windows. The problem is that if I had run file-cache-add-directory, the find-file function starts in the directory of where the current buffer is. I'd like= to make it so that if I supplied a C-u to my-visit-file then it would *not* = start from that current directory. Instead, it should give me a prompt as if I = had done a C-a C-k to get rid of the directory. So, if you made it this far, here's the recap: 1. Does anything already exist that smells like what I want? 2. Can I fix my-visit-file so that a C-u will prevent the default prompt = from being the current directory of the file I'm starting from? (But I do stil= l want filename completion.) 3. Does anyone have a better idea? MTIA :-) --=20 Time flies like the wind. Fruit flies like a banana. Stranger things have= .0. happened but none stranger than this. Does your driver's license say Orga= n ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all= - 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net --------------enig243A29FE3AC749810FF3F77A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iEYEARECAAYFAk0iG4wACgkQRIVy4fC+NyRb1ACcC0zmkhETGFWlxM4QENH1Nl7i I3QAnjjRu6jbN+p5/IDRvOQs5PY5eYEh =4GiY -----END PGP SIGNATURE----- --------------enig243A29FE3AC749810FF3F77A--