home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / help-lucid-emacs / text0246.txt < prev    next >
Encoding:
Text File  |  1993-07-14  |  2.5 KB  |  81 lines

  1.  
  2. >>Is there a way to load files from the directory that
  3. >>emacs was started from, without, in general, having to type the
  4. >>whole leading path name?
  5. >
  6. >I'm not a lucid expert, so I can't answer your question directly, but one
  7. >suggestion I can make is to use unix links.  I frequently visit our site's
  8. >
  9.  
  10. this is another suggestion rather than a solution. i used to use this
  11. occasionally in emacs18.59 and haven't tried in in lemacs.
  12.  
  13. and i know it's ugly, but it works more or less ...
  14.                                 --psb
  15.  
  16. (message "MINIBUFFER behaviour: special char inserts") (sit-for T)
  17.  (define-key minibuffer-local-completion-map "~" 'minibuffer-insert-home-dir)
  18.  (define-key minibuffer-local-completion-map "$" 'minibuffer-insert-mail-spool)
  19.  (define-key minibuffer-local-completion-map ";" 'minibuffer-insert-lisp-dir)
  20.  (define-key minibuffer-local-completion-map "\\" 'minibuffer-insert-TeX-dir)
  21.  (define-key minibuffer-local-completion-map "!" 'minibuffer-insert-src-dir)
  22.  (define-key minibuffer-local-completion-map "+" 'minibuffer-insert-Academics)
  23.  (define-key minibuffer-local-completion-map "=" 'minibuffer-insert-News)
  24.  
  25. ;; idea from: Denis Howe <dbh@doc.ic.ac.uk> H558A Imperial College London
  26. ;; Whenever you hit ~ in the minibuffer it clears the current contents
  27. ;; and inserts ~/ .  If you want a real ~ you can use C-q ~ of course.
  28. ;; (obviates need for find-file-from-home/el-directory --psb)
  29. (defun minibuffer-insert-home-dir ()
  30.   "Replace the minibuffer contents with \"~/\"."
  31.   (interactive)
  32.   (beginning-of-line)
  33.   (or (eobp) (kill-line))
  34.   (insert "~/"))
  35.  
  36. ;; some copy-cat functions
  37. (defun minibuffer-insert-mail-spool ()
  38.   "Replace the minibuffer contents with $mail.
  39.  \(actually, hardcoded, replace with \(getenv $mail\)\) etc."
  40.   (interactive)
  41.   (beginning-of-line)
  42.   (or (eobp) (kill-line))
  43.   (insert "/usr/spool/mail/psb"))
  44.  
  45. (defun minibuffer-insert-lisp-dir ()
  46.   "Replace the minibuffer contents with $emacslispdir."
  47.   (interactive)
  48.   (beginning-of-line)
  49.   (or (eobp) (kill-line))
  50.   (insert "~/emacs/el/"))
  51.  
  52. (defun minibuffer-insert-TeX-dir ()
  53. "mini-buffer hack"
  54.   (interactive)
  55.   (beginning-of-line)
  56.   (or (eobp) (kill-line))
  57.   (insert "~/TeX/"))
  58.  
  59. (defun minibuffer-insert-src-dir ()
  60. "mini-buffer hack"
  61.   (interactive)
  62.   (beginning-of-line)
  63.   (or (eobp) (kill-line))
  64.   (insert "/usr3/src/"))
  65.  
  66. (defun minibuffer-insert-Academics ()
  67. "mini-buffer hack"
  68.   (interactive)
  69.   (beginning-of-line)
  70.   (or (eobp) (kill-line))
  71.   (insert "~/Academics/"))
  72.  
  73. (defun minibuffer-insert-News ()
  74. "mini-buffer hack"
  75.   (interactive)
  76.   (beginning-of-line)
  77.   (or (eobp) (kill-line))
  78.   (insert "~/News/"))
  79.  
  80.  
  81.