diff options
| author | Gregory Heytings | 2023-01-12 19:47:28 +0200 |
|---|---|---|
| committer | Juri Linkov | 2023-01-12 19:47:28 +0200 |
| commit | 9ecebcdded157e1efc2f51b67967fd101797f225 (patch) | |
| tree | 7e0fa2980c9919053d6084ff25590996f4b7d189 | |
| parent | cfd2b3504ab5de6eb5f3c7a0784cb447883e1326 (diff) | |
| download | emacs-9ecebcdded157e1efc2f51b67967fd101797f225.tar.gz emacs-9ecebcdded157e1efc2f51b67967fd101797f225.zip | |
* lisp/simple.el (next-completion): Handle first completion specially.
When completions-header-format is nil and completion-show-help is nil,
the first completion is at the beginning the buffer, so 'M-<down>'
missed it and moved to the second completion. Handle this case by
setting/checking the special text-property 'first-completion' that
is nil at the first call (bug#60411).
| -rw-r--r-- | lisp/simple.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 24df86c80c2..e23ee961879 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -9755,6 +9755,14 @@ Also see the `completion-auto-wrap' variable." | |||
| 9755 | (let ((tabcommand (member (this-command-keys) '("\t" [backtab]))) | 9755 | (let ((tabcommand (member (this-command-keys) '("\t" [backtab]))) |
| 9756 | pos) | 9756 | pos) |
| 9757 | (catch 'bound | 9757 | (catch 'bound |
| 9758 | (when (and (bobp) | ||
| 9759 | (> n 0) | ||
| 9760 | (get-text-property (point) 'mouse-face) | ||
| 9761 | (not (get-text-property (point) 'first-completion))) | ||
| 9762 | (let ((inhibit-read-only t)) | ||
| 9763 | (add-text-properties (point) (1+ (point)) '(first-completion t))) | ||
| 9764 | (setq n (1- n))) | ||
| 9765 | |||
| 9758 | (while (> n 0) | 9766 | (while (> n 0) |
| 9759 | (setq pos (point)) | 9767 | (setq pos (point)) |
| 9760 | ;; If in a completion, move to the end of it. | 9768 | ;; If in a completion, move to the end of it. |