2013-03-17 29 views
0

我很願意做的,就是當我在一個線源,如:<a href="foo.html">foo</a>如何在emacs lisp中使用defjump跳轉到文件中的函數?

我打了一個「跳躍」鍵,它應該匹配href="foo.html"並打開文件c:/project/root/templates/foo.html

我發現jump.el(在emacs的24包「跳」),並想獲得defjump工作:

(require 'jump) 
(defjump 
    'my-follow-ref 
    '(("href=\"\\1\"" . "templates/\\1")) 
    "c:/project/root/" 
    "Follow a logical link from one part of the source to another.") 

我的代碼是基於幫助的例子,但我發現卡在一個非常基本的emacs lisp錯誤:

mapcar: Wrong type argument: listp, quote 

我在做什麼錯?

回答

1

在emacs 24源代碼樹中沒有jump.el,而谷歌沒有幫助,但是,我猜你的問題是不必要的引用:defjump可能是一個宏。

可能這將工作:

(defjump 
    my-follow-ref 
    (("href=\"\\1\"" . "templates/\\1")) 
    "c:/project/root/" 
    "Follow a logical link from one part of the source to another.") 
+0

對於我來說,jump.el只是沒有顯示在'列表packages'爲「跳」,我使用Emacs前奏所以它可能是在另一個回購? – Tom 2013-03-18 01:51:24

+0

你是對的,刪除多餘的引用已修復了類型錯誤。我確信我嘗試了所有的引用,文字等排列,但也許我沒有立即做所有事情! – Tom 2013-03-18 01:55:21

相關問題