using interactive for getting into a specific directory
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
using interactive for getting into a specific directory         


Author: rustom
Date: Nov 14, 2007 18:33

I want to write an interactive function that finds an arbitrary file
from a specific directory "~/org"
The following attempts do not work but should give the idea what I am
trying.

(defun startorg(file)
(interactive "FFile: ")
(let ((default-directory "~/org"))
(find-file file)
))

(defun startorg(file)
(cd "~/org")
(interactive "FFile: ")
(find-file file)
)

The general problem can be stated as:
I want to write an interactive command
-- here startorg -- whose
interactive actions -- here "F..." -- needs preprocessing with another
function -- here cd.
2 Comments
Re: using interactive for getting into a specific directory         


Author: rustom
Date: Nov 14, 2007 21:13

What Ive done for now is this. Dont know if its the proper idiom

(defun startorg(file)
(interactive
(let ((default-directory "~/org/"))
(list (call-interactively 'find-file))
)))

Dont know how its working given that the parameter file is not used!
no comments
Re: using interactive for getting into a specific directory         


Date: Nov 15, 2007 16:28

rustom gmail.com> writes:
> I want to write an interactive function that finds an arbitrary file
> from a specific directory

(interactive (list (read-file-name ...)))

--
Johan Bockgård
no comments

RELATED THREADS
SubjectArticles qty Group
3D interactive spaces using an Interactive Whiteboardsci.edu ·