2012-07-27 73 views
4

搜索查找結束時,你怎麼能在搜索字符串的開頭或結尾的點接受搜索時?將啓動並在Emacs

所以說你做C-S「foobar的」,我想有我的光標在找到字符串的結尾,當我按下RET,並在一開始如果我按C-RET。

感謝

回答

2

試試這個:

(defun my-isearch-exit-other-end() 
    "Exit isearch at the other end" 
    (interactive) 
    (when isearch-forward (goto-char isearch-other-end)) 
    (isearch-exit)) 

(define-key isearch-mode-map (kbd "<C-return>") 'my-isearch-exit-other-end) 
+0

由於看到http://www.emacswiki.org/emacs/ZapToISearch! :-) – sanityinc 2012-07-27 19:32:20