emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature branches review please


From: Ergus
Subject: Re: Feature branches review please
Date: Thu, 5 Nov 2020 22:09:15 +0100

On Thu, Nov 05, 2020 at 08:39:03PM +0000, Gregory Heytings via Emacs 
development discussions. wrote:


How can I checkout that branch?


As I said earlier in this thread, you can have icomplete-vertical without using that branch, with the master branch you only need to `(setq icomplete-separator "\n")'.

If you want a more robust solution however (neither the above nor the branch are always correct),

In which case the branch is not correct?

you'll have to wait. If you don't want to wait, you can try my proposed solution (see attached), which works for any version of Emacs >= 24.

(defvar-local start-display-at-beginning-of-minibuffer nil)
(defun start-display-at-beginning-of-minibuffer (&rest args)
 (when (and start-display-at-beginning-of-minibuffer (minibufferp))
   (set-window-start-at-begin (point-min) (point))))
(defun set-window-start-at-begin (beg end)
 (when (< (+ beg 2) end)
   (set-window-start nil beg)
   (unless (pos-visible-in-window-p end nil t)
     (set-window-start-at-begin (+ beg (/ (- end beg) 2)) end))))
(add-hook 'window-scroll-functions #'start-display-at-beginning-of-minibuffer)
(add-hook 'post-command-hook #'start-display-at-beginning-of-minibuffer)

(setq icomplete-separator "\n")
(add-hook 'icomplete-minibuffer-setup-hook (lambda () (setq 
start-display-at-beginning-of-minibuffer t)))
(defun icomplete-vertical-reformat-completions (completions)
 (save-match-data
   (if (string-match "^\\((.*)\\|\\[.*\\]\\)?{\\(\\(?:.\\|\n\\)+\\)}" 
completions)
       (format "%s \n%s" (or (match-string 1 completions) "") (match-string 2 
completions))
     completions)))
(advice-add 'icomplete-completions :filter-return 
#'icomplete-vertical-reformat-completions)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]