[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Shortcuts?
From: |
Chuck Siska |
Subject: |
Re: [h-e-w] Shortcuts? |
Date: |
Thu, 28 Feb 2002 11:13:45 -0800 |
chris --
try this attached .el file. it lets you follow a M$ shortcut
from dired to the target file or directory. it works on
M$Wind98. if M$ hasn't been too squirrely, it will work for you.
it binds 'F' (as opposed to the normal 'f') to do this.
cheers.
-- chuck
address@hidden wrote:
> address@hidden writes:
> > Since Emacs on windows doesn't seem to follow shortcuts, is
> > there some simple way to define some shortcuts when finding
> > files? Many of my documents rest fairly deep in my folder
> > structure, so navigating from one to the other can be
> > painfully slow... particularly when C-x C-f starts out in the
> > home folder... even being able to change that so it would
> > begin in a specific folder would be a partial workaround...
> You can change the "Start in:" field of your desktop shortcut
> if you like. You can even make multiple instances each with a
> different value (and name!) if you like. Not the way I'd do it.
> C-h v default-directory should steer you toward the "cd"
> function which might help.
> emacs also recognizes environment variables. Use $NAME to
> access the file defined by the NAME environment variable.
> You can use "M-x setenv" to set variables within emacs or
> (setenv "FILES" "d:/direct/subdir/") in your .emacs
> note: be careful when dealing with spaces and backslashes
--
|\_/\_.-'""``:-._
What is life without looking for . . `; -._ )-;-,_`)
the next cute little bug to play with? v_,- _ ),(,.\ ``-'
_.- _.,-_/ / ((.'
-- address@hidden `<}:.. ((,.-' ((,/
;;; -*- Emacs-Lisp -*-
;;; cs-shortcut.el -- Visit file via an M$Wind shortcut file in Dired.
;; Time-stamp: <2002-02-28 11:03:12 Chuck Siska>
;
;;; Author: Chuck Siska <address@hidden>
; This file (consisting of these 3 functions) will bind in Dired the "F"
; key if it is undefined (which is typically the case) to a function
; which will read an M$Wind shortcut file, extract the shortcut's target
; file, and then visit that file as if the user typed "f" (which is the
; normal Dired file visiting key).
; During this process, a temporary buffer will be created, called
; "*cs-shortcut*" into which the shortcut file will be read. (Note, we
; could kill this buffer after processing, but we prefer to leave small
; amounts of evidence for debugging purposes -- there is always a next
; bug;-)
; These functions have been tested on an M$Wind98 system -- your mileage
; may vary -- but we hope it doesn't. Note that M$ is notorious for
; arbitrarily changing things around on each release in order to protect
; the favored (which may not include you;-)
; The cs-dired-find-file-via-shortcut function is a cheap modification
; of dired-find-file. It can be called interactively just like its
; namesake.
; Note, all this is a quick hack. While it seems to be working for us,
; there is every reason to expect more gremlins in your neck of the
; woods, so tighten your belt buckaroo. But, perhaps we exaggerate.
;; We use the dired mode keymap, so we need dired.
(require 'dired)
; Here, we grab the target name from the shortcut file.
(defun cs-find-filename-in-shortcut ( shortcut-filename )
"Return target absolute path and filename from M$Wind shortcut.
Creates and fills buffer *cs-shortcut* with the shortcut's guts."
(save-excursion
(let ((snip1 "")
(snip2 " ")
(snip3 "