Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lisp code to use short cuts to launch file

2 views
Skip to first unread message

Graham Smith

unread,
Oct 19, 2008, 2:22:12 PM10/19/08
to help-gn...@gnu.org
When I used emacs before, I used some code in .emacs that allowed me
to open a file using a shortcut name, the path and file associated
with the shortcut being set up in .emacs.

Of course now that I want to use it again, I can't find any reference
to the code I need to use.

Can someone tell me what it is I need to use.

Many thanks,

Graham


Xah

unread,
Oct 19, 2008, 6:51:53 PM10/19/08
to

perhaps you mean something like this?

; open my unicode template with F8 key
(global-set-key (kbd "<f8>")
(lambda () (interactive) (find-file "~/my_unicode_template.txt")))

Xah
http://xahlee.org/


David Golden

unread,
Oct 19, 2008, 10:04:33 PM10/19/08
to
Graham Smith wrote:

Probably nothing to do with windoze explorer shell "shortcut" files...

One thing you might do is associate short filenames with longer real
files with your own file-name-handler (see file-name-handler-alist).
That all seems like a lot of boilerplate to code up though.

so.. why bother? environment variables are usable in vaguely recent gnu
emacs (not sure what part actually implements it, might be tramp, might
be core, either way, they work...)

So, if you want a bunch of "shortcut" pseudo-filenames, then just set a
bunch of env vars in your .emacs (or elsewhere, like your
shell .profile, seeing as they're just as handy outside emacs) e.g.
in .emacs

(setenv "inky" "/home/david/src/inky-0.9.7/inkymain.c")

Then you can do e.g.
C-x C-f C-S-backspace $inky
to open it. (C-S-backspace just to clear away the default path)
They even tab-complete.

0 new messages