[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some help with icomplete
From: |
Zhengyi Fu |
Subject: |
Re: Some help with icomplete |
Date: |
Tue, 16 Apr 2024 15:46:56 +0800 |
User-agent: |
mu4e 1.12.2; emacs 29.3 |
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"
--
Zhengyi Fu