help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Some help with icomplete


From: Rahul Martim Juliato
Subject: Re: Some help with icomplete
Date: Tue, 16 Apr 2024 11:18:36 -0300
User-agent: Gnus/5.13 (Gnus v5.13)

Zhengyi Fu <i@fuzy.me> writes:

> Rahul Martim Juliato <rahuljuliato@gmail.com> writes:
>
>> Thing is, the list always starts on the next line (that is ok) but on
>> the first column. So it is very strange to M-TAB with the cursor on
>> column 50 and get a list on column 0. If I were using plain
>> `icomplete-mode' (no vertical), it would complete horizontally from the
>> place my cursor is at the moment.
>>
>> Can anyone elucidate me on how to make it work the way I'd like to?
>
> If you compile Emacs from source, you can try this patch:
>
> Index: emacs/lisp/icomplete.el
> ===================================================================
> --- emacs.orig/lisp/icomplete.el
> +++ emacs/lisp/icomplete.el
> @@ -913,6 +913,16 @@ icomplete--render-vertical
>                   ((> (length scroll-above) (length scroll-below)) nsections)
>                   (t (min (ceiling nsections 2) (length scroll-above))))
>             lines))
> +    (when icomplete--in-region-buffer
> +      (let ((column
> +          (with-current-buffer icomplete--in-region-buffer
> +            (save-excursion
> +              (goto-char (car completion-in-region--data))
> +              (current-column)))))
> +     (dolist (l lines)
> +       (add-text-properties
> +           0 1 `(display ,(concat (make-string column ?\s) (substring l 0 
> 1)))
> +           l))))
>      ;; At long last, render final string return value.  This may still
>      ;; kick out lines at the end.
>      (concat " \n"

Thank you Zhengyi!

This worked like a charm!

Is this already suggested as a patch to Emacs core?

Even if optional, I believe Emacs would greatly benefit from it.


Rahul M. Juliato



reply via email to

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