[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/ido.el,v
From: |
Kim F. Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/ido.el,v |
Date: |
Wed, 24 Jan 2007 00:07:34 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Kim F. Storm <kfstorm> 07/01/24 00:07:34
Index: ido.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ido.el,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- ido.el 22 Jan 2007 22:37:25 -0000 1.123
+++ ido.el 24 Jan 2007 00:07:34 -0000 1.124
@@ -1040,6 +1040,10 @@
(defvar ido-incomplete-regexp nil
"Non-nil if an incomplete regexp is entered.")
+(defvar ido-initial-position nil
+ "Non-nil means to explicitly cursor on entry to minibuffer.
+Value is an integer which is number of chars to right of prompt.")
+
;;; Variables with dynamic bindings.
;;; Declared here to keep the byte compiler quiet.
@@ -1852,6 +1856,8 @@
(if (member ido-default-item ido-ignore-item-temp-list)
(setq ido-default-item nil))
(ido-trace "new default" ido-default-item)
+ (if ido-default-item
+ (setq ido-initial-position 0))
(setq ido-set-default-item nil))
(if ido-process-ignore-lists-inhibit
@@ -2122,11 +2128,14 @@
ido-selected))
(defun ido-edit-input ()
- "Edit absolute file name entered so far with ido; terminate by RET."
+ "Edit absolute file name entered so far with ido; terminate by RET.
+If cursor is not at the end of the user input, move to end of input."
(interactive)
+ (if (not (eobp))
+ (end-of-line)
(setq ido-text-init (if ido-matches (ido-name (car ido-matches)) ido-text))
(setq ido-exit 'edit)
- (exit-minibuffer))
+ (exit-minibuffer)))
;;; MAIN FUNCTIONS
(defun ido-buffer-internal (method &optional fallback prompt default initial
switch-cmd)
@@ -2544,6 +2553,10 @@
(cond
((> (point) (minibuffer-prompt-end))
(forward-char -1))
+ ((eq last-command this-command)
+ (when (and (memq ido-cur-item '(file dir))
+ (not (bobp)))
+ (ido-push-dir))) ; else do nothing
((eq ido-cur-item 'buffer)
(ido-fallback-command))
(ido-context-switch-command
@@ -2593,6 +2606,8 @@
(defun ido-toggle-ignore ()
"Toggle ignoring files specified with `ido-ignore-files'."
(interactive)
+ (if (and (not (eobp)) (> (point) (minibuffer-prompt-end)))
+ (goto-char (minibuffer-prompt-end))
(if ido-directory-too-big
(progn
(message "Reading directory...")
@@ -2600,7 +2615,7 @@
(setq ido-process-ignore-lists (not ido-process-ignore-lists)))
(setq ido-text-init ido-text)
(setq ido-exit 'refresh)
- (exit-minibuffer))
+ (exit-minibuffer)))
(defun ido-toggle-vc ()
"Disable version control for this file."
@@ -3785,8 +3800,11 @@
;;; KILL CURRENT BUFFER
(defun ido-kill-buffer-at-head ()
- "Kill the buffer at the head of `ido-matches'."
+ "Kill the buffer at the head of `ido-matches'.
+If cursor is not at the end of the user input, delete to end of input."
(interactive)
+ (if (not (eobp))
+ (kill-line)
(let ((enable-recursive-minibuffers t)
(buf (ido-name (car ido-matches))))
(when buf
@@ -3796,12 +3814,15 @@
;; buffer couldn't be killed.
(setq ido-rescan t)
;; else buffer was killed so remove name from list.
- (setq ido-cur-list (delq buf ido-cur-list))))))
+ (setq ido-cur-list (delq buf ido-cur-list)))))))
;;; DELETE CURRENT FILE
(defun ido-delete-file-at-head ()
- "Delete the file at the head of `ido-matches'."
+ "Delete the file at the head of `ido-matches'.
+If cursor is not at the end of the user input, delete to end of input."
(interactive)
+ (if (not (eobp))
+ (kill-line)
(let ((enable-recursive-minibuffers t)
(file (ido-name (car ido-matches))))
(if file
@@ -3817,7 +3838,7 @@
;; file could not be deleted
(setq ido-rescan t)
;; else file was killed so remove name from list.
- (setq ido-cur-list (delq (car ido-matches) ido-cur-list))))))
+ (setq ido-cur-list (delq (car ido-matches) ido-cur-list)))))))
;;; VISIT CHOSEN BUFFER
@@ -4453,7 +4474,10 @@
(when (featurep 'xemacs)
(ido-exhibit)
(goto-char (point-min)))
- (run-hooks 'ido-minibuffer-setup-hook)))
+ (run-hooks 'ido-minibuffer-setup-hook)
+ (when ido-initial-position
+ (goto-char (+ (minibuffer-prompt-end) ido-initial-position))
+ (setq ido-initial-position nil))))
(defun ido-tidy ()
"Pre command hook for `ido'."