From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rahul Martim Juliato Newsgroups: gmane.emacs.help Subject: Re: Some help with icomplete Date: Tue, 16 Apr 2024 11:18:36 -0300 Message-ID: <87plup8k77.fsf@gmail.com> References: <87y19esfds.fsf@gmail.com> <87cyqpycjz.fsf@fuzy.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11809"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Rahul Martim Juliato , help-gnu-emacs@gnu.org To: Zhengyi Fu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 16 16:19:13 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 1rwjeT-0002m3-1M for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 16 Apr 2024 16:19:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwje0-0007UR-QU; Tue, 16 Apr 2024 10:18:44 -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 1rwjdz-0007Tr-8M for help-gnu-emacs@gnu.org; Tue, 16 Apr 2024 10:18:43 -0400 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwjdx-0006A2-Lp for help-gnu-emacs@gnu.org; Tue, 16 Apr 2024 10:18:43 -0400 Original-Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2a502547460so3006569a91.2 for ; Tue, 16 Apr 2024 07:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713277119; x=1713881919; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5pSeBJ2ilf/bjMdaKyNyjFFlOqewlf5P7RAKA8Hizr8=; b=C3iW4DhLT8T6+tewT9Dlxjb5oAHxALxlScsYcH7D9z7vOAcCwXU0hEhxljJzlCVzQL kX4Ob6ZHT8lPTLjSGWJMvYqRu003IquLUDhOi6iQIuJxcrJicdwsrmk+JfNx2/EIr84D VPsjnmyn8f9w86Nod4aAqbcoqGz4p65Rtsn8VrklBKw48N5P5UsceAs0yGMM1W8KRzZ9 6puWsyU1+tN2R++sabqlYzk/hbq8F51wiT+yvx7G1UZlYlpEwaajs3MU5GQuvqs7ma7H BcHCw26x4UFqUJcbvyrbXy6wfLtxikKeOQ1jz5givPqLGHqjDGrOwbjUm7Ip2wGTk9PW rpuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713277119; x=1713881919; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5pSeBJ2ilf/bjMdaKyNyjFFlOqewlf5P7RAKA8Hizr8=; b=MlYJlDMQZqsPJy+2g0sTthZGMqrs04jc2U+3Pz8ZCNnJ8fkLsbR83Msg/AmidntM0F KLNpXmAa0KWqgP6LSfHjIW9+RhZcBaisah99REbys2oS4iJNZ2g6Wh86E1PIlEUge7Ay GAFpa4c/I5jvq9LaucMNg/xzRdBTmgBNDnKKF5LmQ5G41pdlIGaK6HClGSJKFno4vXK3 36LaihwR+30wfg42gTAmuEfEpCnQ0qhdE0V+sMSjPlR+EFvrWTvl08r8wf43P4k0b82+ fwRfTZdexTg7RWlYX9rDMcaroLuTI0Iiq+1O+4pTh5k6srhrDdE4+NJNmmyLlIJ01PuB Gwiw== X-Forwarded-Encrypted: i=1; AJvYcCXI2AO7W/ZVwTOhCI499dj2WJ48JX6VqXrm7CPaDYie/zuqHi1fAvrbTgMMzU45LevJvAyER1QKeuJeCVrBFoNJCs+vQR8A X-Gm-Message-State: AOJu0YzVlBYHJDjTCxc7PM2j3wRCthxRCMJiACHmyCJqZRnPQBulQrWo 7QdOrj/S9kXDTyjKduI2MBrFGycXcYaTdobDAZqupgNUIzL4aAH92r++hw== X-Google-Smtp-Source: AGHT+IEJBuswszJGw3K5rUVoHLeBoPHWsNmXhaTmO4ZN7mqX1GQnttPkZ+f9dh6OqKgNxL/IMnzH7w== X-Received: by 2002:a17:90a:989:b0:2a7:a36c:140b with SMTP id 9-20020a17090a098900b002a7a36c140bmr7730837pjo.36.1713277119351; Tue, 16 Apr 2024 07:18:39 -0700 (PDT) Original-Received: from debian ([2804:7f0:9182:59e:b039:8a83:9fec:bc6d]) by smtp.gmail.com with ESMTPSA id v19-20020a17090a459300b002a2a845868asm8854895pjg.57.2024.04.16.07.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:18:38 -0700 (PDT) X-Google-Original-From: Rahul Martim Juliato In-Reply-To: <87cyqpycjz.fsf@fuzy.me> (Zhengyi Fu's message of "Tue, 16 Apr 2024 15:46:56 +0800") Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=rahuljuliato@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:146342 Archived-At: Zhengyi Fu writes: > 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" 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