diff options
| author | Lars Ingebrigtsen | 2019-07-15 20:52:48 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-15 20:52:48 +0200 |
| commit | b7fcfc64120f95ed16721b4c5cdc737b45c5b78c (patch) | |
| tree | 6e4e1cbba80f9cd96373153cc2b7bc9ace156fcf | |
| parent | 93e1f7c66f77827bcad7a5636c3edcff685ca19e (diff) | |
| download | emacs-b7fcfc64120f95ed16721b4c5cdc737b45c5b78c.tar.gz emacs-b7fcfc64120f95ed16721b4c5cdc737b45c5b78c.zip | |
Fix INITIAL-INPUT cons handling in ido-read-internal
* lisp/ido.el (ido-read-internal): Is INITIAL-INPUT is a cons that
specifies cursor position, adjust the number to be palatable for
`read-for-minibuffer' (bug#27807).
| -rw-r--r-- | lisp/ido.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index bf2c74558ac..e14f0151690 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1905,7 +1905,14 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1905 | ) | 1905 | ) |
| 1906 | 1906 | ||
| 1907 | (ido-setup-completion-map) | 1907 | (ido-setup-completion-map) |
| 1908 | (setq ido-text-init initial) | 1908 | |
| 1909 | (setq ido-text-init | ||
| 1910 | (if (consp initial) | ||
| 1911 | (cons (car initial) | ||
| 1912 | ;; `completing-read' uses 0-based index while | ||
| 1913 | ;; `read-from-minibuffer' uses 1-based index. | ||
| 1914 | (1+ (cdr initial))) | ||
| 1915 | initial)) | ||
| 1909 | (setq ido-input-stack nil) | 1916 | (setq ido-input-stack nil) |
| 1910 | 1917 | ||
| 1911 | (run-hooks 'ido-setup-hook) | 1918 | (run-hooks 'ido-setup-hook) |