;; calculated, This causes the first cached completion to
;; be taken (i.e. the one that the user sees highlighted)
completion-all-sorted-completions)
- (minibuffer-force-complete-and-exit)
+ (if (window-minibuffer-p)
+ (minibuffer-force-complete-and-exit)
+ (minibuffer-force-complete (icomplete--field-beg)
+ (icomplete--field-end)
+ 'dont-cycle)
+ (completion-in-region-mode -1))
;; Otherwise take the faster route...
- (minibuffer-complete-and-exit)))
+ (if (window-minibuffer-p)
+ (minibuffer-complete-and-exit)
+ (completion-complete-and-exit
+ (icomplete--field-beg)
+ (icomplete--field-end)
+ (lambda () (completion-in-region-mode -1))))))
(defun icomplete-force-complete ()
"Complete the icomplete minibuffer."
(interactive)
;; We're not at all interested in cycling here (bug#34077).
- (minibuffer-force-complete nil nil 'dont-cycle))
+ (if (window-minibuffer-p)
+ (minibuffer-force-complete nil nil 'dont-cycle)
+ (minibuffer-force-complete (icomplete--field-beg)
+ (icomplete--field-end)
+ 'dont-cycle)))
;; Apropos `icomplete-scroll', we implement "scrolling icomplete"
;; within classic icomplete, which is "rotating", by contrast.