help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: build a macro that opens a directory and prompts for file name


From: Sebastian Tennant
Subject: Re: build a macro that opens a directory and prompts for file name
Date: Thu, 29 Jan 2009 13:08:22 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Quoth Norm <NormanBauer@gmail.com>:
> I have been googleing and reading the docs trying to figure out a
> solution to this. I spend the majority of my time working in a single
> directory on a CIFS server and I am always doing a C-x C-f \\server\dir
> \long_sub_dir\subdir\filename
>
> In the spirit of emacs I'd like to automate it so that when I do C-co
> it knows the directory and simply prompts me for the file to be opened
> or if I leave it blank and press RET it lists the directory.
>
> Any suggestions on how to accomplish this.

I don't have time to read this (fairly long) thread but I've been using
a (tiny) macro for years which I think may meet your needs perfectly.

You can get it from here:

 http://article.gmane.org/gmane.emacs.sources/3157

In your case, you could define a command 'M-x cifs' in your ~/.emacs
like so:

 (require 'commandir)

 (commandir cifs                                  ; command name
            "CIFS hosted filename: "              ; prompt
            "\\server\dir=long_sub_dir\subdir"    ; directory
            "<name-of-file-you-visit-most"        ; default
            )

The great thing is you can define as many commands as you like:

 (commandir cifs2 ...)


HTH,

Sebastian
-- 
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.
http://home.gna.org/eap





reply via email to

[Prev in Thread] Current Thread [Next in Thread]