From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zhengyi Fu Newsgroups: gmane.emacs.help Subject: Re: Some help with icomplete Date: Tue, 16 Apr 2024 15:46:56 +0800 Message-ID: <87cyqpycjz.fsf@fuzy.me> References: <87y19esfds.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38176"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.2; emacs 29.3 Cc: help-gnu-emacs@gnu.org To: Rahul Martim Juliato Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 16 09:47:55 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rwdXn-0009hi-Hs for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 16 Apr 2024 09:47:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwdXK-0007pF-JG; Tue, 16 Apr 2024 03:47:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwdXH-0007p3-Og for help-gnu-emacs@gnu.org; Tue, 16 Apr 2024 03:47:23 -0400 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwdX8-0000g8-Oz for help-gnu-emacs@gnu.org; Tue, 16 Apr 2024 03:47:23 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 844BD1C0005; Tue, 16 Apr 2024 07:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fuzy.me; s=gm1; t=1713253625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=HMFvmKQttK5IuDNT0Ay0js9KoIwsazAjs4O1XDdBw0g=; b=LaAP7xm49UYaIlWYBX38HH9VGjcUvz8OeK4UDkOAQf2kC7tatWemptHQAob3rCe2lNy/R9 64YT7IrwPFBIOP42+FVqrR8ZCM6ji+qwlZ5zvEe9oKPmsqYwB4AUM8YtyzzRonJpwcCkr7 LsDlSrEq9fGvAL1pQh6q7bEQAwk1dqqwydVCKXWA1GNWhqJ/G2fJzzkWEQYuO3e8OkIkOI oZku6kerhE6U0j2W3R2KPigACM+aCE84UmPd66KVEsqUpI1zLxKMBMVss/CMj6AjviVH2t Wj3V5N5caYmf88fvaUK9akLpNCAWQhUKYAfhq7bZNbUwLd1Icpu4drhCzFnb6g== In-Reply-To: <87y19esfds.fsf@gmail.com> (Rahul Martim Juliato's message of "Mon, 15 Apr 2024 14:30:07 -0300") Autocrypt: addr=i@fuzy.me; prefer-encrypt=mutual; keydata= mDMEZd/p6xYJKwYBBAHaRw8BAQdAgfxm2J8gGxjf4AdWV2tbEeyvKgwJXzqM8YP+94TCVpC0Flpo ZW5neWkgRnUgPGlAZnV6eS5tZT6IlAQTFgoAPBYhBKvlCzHi8MlKxFhbx42Xvz9r+gvaBQJl3+nr AhsDBQkB4TOABAsJCAcEFQoJCAUWAgMBAAIeBQIXgAAKCRCNl78/a/oL2pUpAQCK73vpSpFmZCnW 8uSjF5oPX7o4vF0ZyE402niPCDgokAEAiQAd9Zatc3d1wut9k/hu35IWSRTGYrjpHAXxHQofhge4 OARl3+nrEgorBgEEAZdVAQUBAQdAEhCj39QK+6jFSqUC2BbRkdtqRk2mQ/Vsmc1LkCGhQWQDAQgH iH4EGBYKACYWIQSr5Qsx4vDJSsRYW8eNl78/a/oL2gUCZd/p6wIbDAUJAeEzgAAKCRCNl78/a/oL 2nA4AQCHPVWH59hKZywHRETK0RGzM0EPoZXcAQgODXO+UTCZMgD9FH2WPMfr6qtWwfE6bTPbLr3m c4e3XtgnBlhDyokwoAK4MwRl5Y0qFgkrBgEEAdpHDwEBB0A5XU/3jujthG0KBIaTJONjeJxyWYvB V6bMEA17KBFYgIh+BBgWCAAmFiEEq+ULMeLwyUrEWFvHjZe/P2v6C9oFAmXljSoCGyAFCQDtTgAA CgkQjZe/P2v6C9qvpQD+MhFoxnZUUsFTNJWQhDcgtsXtTza89Wifd1Eshl5M1FYA/jqNr4FXv4b7 GVC3MYKbwKPqS0OElnfn/kCHWK2BIH0O X-GND-Sasl: id@fuzy.me Received-SPF: pass client-ip=2001:4b98:dc4:8::225; envelope-from=i@fuzy.me; helo=relay5-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146339 Archived-At: Rahul Martim Juliato 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