aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2003-02-03 22:33:13 +0000
committerKim F. Storm2003-02-03 22:33:13 +0000
commitf0a73ccce1336f6fa8889c51b002f1c14cbe3082 (patch)
tree02e5a8fbfd86e073092e20560d0ec466bccd7f5c
parent3d7ca22355faee835e817dc642f4b052728287eb (diff)
downloademacs-f0a73ccce1336f6fa8889c51b002f1c14cbe3082.tar.gz
emacs-f0a73ccce1336f6fa8889c51b002f1c14cbe3082.zip
(ido-define-mode-map): Remap viper delete char/word
commands to their ido specific equivalents. Disable ESC in viper mode (to avoid exiting insert mode), since ido doesn't work in viper command mode. (ido-delete-backward-updir, ido-delete-backward-word-updir): Handle remapped viper commands.
-rw-r--r--lisp/ido.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index cef907be3b4..0391ec68b4a 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1352,6 +1352,12 @@ This function also adds a hook to the minibuffer."
1352 (define-key map "\C-k" 'ido-kill-buffer-at-head) 1352 (define-key map "\C-k" 'ido-kill-buffer-at-head)
1353 ) 1353 )
1354 1354
1355 (when (if (boundp 'viper-mode) viper-mode)
1356 (define-key map [remap viper-backward-char] 'ido-delete-backward-updir)
1357 (define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir)
1358 (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir)
1359 (define-key map [remap viper-intercept-ESC-key] 'ignore))
1360
1355 (setq ido-mode-map map) 1361 (setq ido-mode-map map)
1356 (run-hooks 'ido-define-mode-map-hook))) 1362 (run-hooks 'ido-define-mode-map-hook)))
1357 1363
@@ -2166,6 +2172,10 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
2166 (ido-up-directory t))) 2172 (ido-up-directory t)))
2167 ((and ido-pre-merge-state (string-equal (car ido-pre-merge-state) ido-text)) 2173 ((and ido-pre-merge-state (string-equal (car ido-pre-merge-state) ido-text))
2168 (ido-undo-merge-work-directory (substring ido-text 0 -1) t t)) 2174 (ido-undo-merge-work-directory (substring ido-text 0 -1) t t))
2175 ((eq this-original-command 'viper-backward-char)
2176 (funcall this-original-command (prefix-numeric-value count)))
2177 ((eq this-original-command 'viper-del-backward-char-in-insert)
2178 (funcall this-original-command))
2169 (t 2179 (t
2170 (delete-backward-char (prefix-numeric-value count))))) 2180 (delete-backward-char (prefix-numeric-value count)))))
2171 2181
@@ -2175,7 +2185,9 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
2175 (if (= (minibuffer-prompt-end) (point)) 2185 (if (= (minibuffer-prompt-end) (point))
2176 (if (not count) 2186 (if (not count)
2177 (ido-up-directory t)) 2187 (ido-up-directory t))
2178 (backward-kill-word (prefix-numeric-value count)))) 2188 (if (eq this-original-command 'viper-delete-backward-word)
2189 (funcall this-original-command (prefix-numeric-value count))
2190 (backward-kill-word (prefix-numeric-value count)))))
2179 2191
2180(defun ido-get-work-directory (&optional incr must-match) 2192(defun ido-get-work-directory (&optional incr must-match)
2181 (let ((n (length ido-work-directory-list)) 2193 (let ((n (length ido-work-directory-list))