lisp/icomplete.el (icomplete-fido-backward-updir): Expand "~/"
* lisp/icomplete.el (icomplete-fido-backward-updir): Expand "~/" (bug#43925).
This commit is contained in:
parent
81535cd878
commit
87e5357886
1 changed files with 11 additions and 7 deletions
|
@ -380,13 +380,17 @@ if that doesn't produce a completion match."
|
|||
(defun icomplete-fido-backward-updir ()
|
||||
"Delete char before or go up directory, like `ido-mode'."
|
||||
(interactive)
|
||||
(if (and (eq (char-before) ?/)
|
||||
(eq (icomplete--category) 'file))
|
||||
(save-excursion
|
||||
(goto-char (1- (point)))
|
||||
(when (search-backward "/" (point-min) t)
|
||||
(delete-region (1+ (point)) (point-max))))
|
||||
(call-interactively 'backward-delete-char)))
|
||||
(cond ((and (eq (char-before) ?/)
|
||||
(eq (icomplete--category) 'file))
|
||||
(when (string-equal (icomplete--field-string) "~/")
|
||||
(delete-region (icomplete--field-beg) (icomplete--field-end))
|
||||
(insert (expand-file-name "~/"))
|
||||
(goto-char (line-end-position)))
|
||||
(save-excursion
|
||||
(goto-char (1- (point)))
|
||||
(when (search-backward "/" (point-min) t)
|
||||
(delete-region (1+ (point)) (point-max)))))
|
||||
(t (call-interactively 'backward-delete-char))))
|
||||
|
||||
(defvar icomplete-fido-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
|
|
Loading…
Add table
Reference in a new issue