diff options
| author | Richard M. Stallman | 1994-08-06 21:51:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-08-06 21:51:31 +0000 |
| commit | ab63960fcfadeca67b2777e66cfaea04ee459b69 (patch) | |
| tree | d80470b58dcd1744862118ed905f0f521f2a641a | |
| parent | 62057cefc1ae55ad555bbeadea006ca951bf5b1b (diff) | |
| download | emacs-ab63960fcfadeca67b2777e66cfaea04ee459b69.tar.gz emacs-ab63960fcfadeca67b2777e66cfaea04ee459b69.zip | |
(choose-completion): Bury or iconify the completion list
using code copied from mouse-choose-completion.
| -rw-r--r-- | lisp/simple.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 839874a6e9e..1b384bee41a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2483,7 +2483,7 @@ it were the arg to `interactive' (which see) to interactively read the value." | |||
| 2483 | (defun choose-completion () | 2483 | (defun choose-completion () |
| 2484 | "Choose the completion that point is in or next to." | 2484 | "Choose the completion that point is in or next to." |
| 2485 | (interactive) | 2485 | (interactive) |
| 2486 | (let (beg end) | 2486 | (let (beg end completion (buffer completion-reference-buffer)) |
| 2487 | (if (and (not (eobp)) (get-text-property (point) 'mouse-face)) | 2487 | (if (and (not (eobp)) (get-text-property (point) 'mouse-face)) |
| 2488 | (setq end (point) beg (1+ (point)))) | 2488 | (setq end (point) beg (1+ (point)))) |
| 2489 | (if (and (not (bobp)) (get-text-property (1- (point)) 'mouse-face)) | 2489 | (if (and (not (bobp)) (get-text-property (1- (point)) 'mouse-face)) |
| @@ -2492,7 +2492,16 @@ it were the arg to `interactive' (which see) to interactively read the value." | |||
| 2492 | (error "No completion here")) | 2492 | (error "No completion here")) |
| 2493 | (setq beg (previous-single-property-change beg 'mouse-face)) | 2493 | (setq beg (previous-single-property-change beg 'mouse-face)) |
| 2494 | (setq end (or (next-single-property-change end 'mouse-face) (point-max))) | 2494 | (setq end (or (next-single-property-change end 'mouse-face) (point-max))) |
| 2495 | (choose-completion-string (buffer-substring beg end)))) | 2495 | (setq completion (buffer-substring beg end)) |
| 2496 | (let ((owindow (selected-window))) | ||
| 2497 | (if (and (one-window-p t 'selected-frame) | ||
| 2498 | (window-dedicated-p (selected-window))) | ||
| 2499 | ;; This is a special buffer's frame | ||
| 2500 | (iconify-frame (selected-frame)) | ||
| 2501 | (or (window-dedicated-p (selected-window)) | ||
| 2502 | (bury-buffer))) | ||
| 2503 | (select-window owindow)) | ||
| 2504 | (choose-completion-string completion buffer))) | ||
| 2496 | 2505 | ||
| 2497 | ;; Delete the longest partial match for STRING | 2506 | ;; Delete the longest partial match for STRING |
| 2498 | ;; that can be found before POINT. | 2507 | ;; that can be found before POINT. |