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

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

Geosoft File Finder


From: Johan Josefsson
Subject: Geosoft File Finder
Date: Thu, 24 Aug 2006 22:59:40 +0200

Hi all,

I have some trouble getting Geosoft File Finder working
(http://geosoft.no/development/emacs.html#File Finder). The actual
short snippet of code is attached at the end of this post.

From the explanation written on the site it should work something like this:

1) A keyword is defined, in my case "Java".
2) This keyword is associated with a location, in my case "D:/archive/code".
3) The function then uses autocompletion in the minibuffer to give the
correct path based on the keyword.

Example:

"Ja<SPC>" should complete into "D:/archive/code", in minibuffer.

That is at least how I read the explanation on their site.

However, when trying to use the code (w32 emacs 21.3 and 22.0), the
only thing that happens is   that I get a [No Match] when pressing
space after typing "Ja". I also tried binding it to F5 to rule out
that it had something
to do with the specific key choosen, with no luck.

So, any ideas what I do wrong here?

//Johan

File Finder code:

(defun geosoft-parse-minibuffer ()
 ;; Extension to the complete word facility of the minibuffer
 (interactive)
 (backward-char 4)
 (setq found t)
 (cond
    ; local directories
    ((looking-at "..cd") (setq directory "c:/users/john/"))
    ((looking-at ".doc") (setq directory "c:/users/john/documents/"))
    ((looking-at "java") (setq directory "c:/users/john/src/java/"))
    (t (setq found nil)))
 (cond (found (beginning-of-line)
               (kill-line)
               (insert directory))
        (t     (forward-char 4)
               (minibuffer-complete))))

Used with:

(define-key minibuffer-local-completion-map " " 'geosoft-parse-minibuffer)




reply via email to

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