From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#591: 23.0.60; lisp-complete-symbol erases extra text Date: Fri, 3 Oct 2008 09:55:07 -0700 Message-ID: <003a01c92578$ca9586b0$0200a8c0@us.oracle.com> References: <87ej5czaef.fsf@stupidchicken.com> Reply-To: Drew Adams , 591@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223053919 27038 80.91.229.12 (3 Oct 2008 17:11:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Oct 2008 17:11:59 +0000 (UTC) To: "'Stefan Monnier'" , <591@emacsbugs.donarmstrong.com>, "'Chong Yidong'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 03 19:12:55 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KloBh-0002Fe-Q1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Oct 2008 19:11:34 +0200 Original-Received: from localhost ([127.0.0.1]:55093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KloAe-0003oU-Kn for geb-bug-gnu-emacs@m.gmane.org; Fri, 03 Oct 2008 13:10:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KloAC-0003bh-5r for bug-gnu-emacs@gnu.org; Fri, 03 Oct 2008 13:10:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KloAB-0003bE-GT for bug-gnu-emacs@gnu.org; Fri, 03 Oct 2008 13:09:59 -0400 Original-Received: from [199.232.76.173] (port=35064 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KloAB-0003bA-A8 for bug-gnu-emacs@gnu.org; Fri, 03 Oct 2008 13:09:59 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48160) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KloAA-0001x6-QH for bug-gnu-emacs@gnu.org; Fri, 03 Oct 2008 13:09:59 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m93H9uxO012060; Fri, 3 Oct 2008 10:09:56 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m93H54sP010862; Fri, 3 Oct 2008 10:05:04 -0700 X-Loop: don@donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 03 Oct 2008 17:05:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 591 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 591-submit@emacsbugs.donarmstrong.com id=B591.12230529268861 (code B ref 591); Fri, 03 Oct 2008 17:05:04 +0000 Original-Received: (at 591) by emacsbugs.donarmstrong.com; 3 Oct 2008 16:55:26 +0000 Original-Received: from agminet01.oracle.com (agminet01.oracle.com [141.146.126.228]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m93GtNIF008854 for <591@emacsbugs.donarmstrong.com>; Fri, 3 Oct 2008 09:55:24 -0700 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m93GtCRc013881; Fri, 3 Oct 2008 11:55:12 -0500 Original-Received: from acsmt707.oracle.com (acsmt707.oracle.com [141.146.40.85]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m93Gt7B7029860; Fri, 3 Oct 2008 10:55:07 -0600 Original-Received: from dradamslap1 (/24.23.165.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Oct 2008 09:55:07 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acjxylff/npo8P82R1eOYqVr6YBdbgzqsAUg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 03 Oct 2008 13:09:59 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21049 Archived-At: > From: Stefan Monnier Sent: Tuesday, July 29, 2008 3:08 PM > > Hi Stefan, This bug was introduced by your patch: > > Yes, I know. > > > This sets completion-base-size to 0, which causes the completions > > buffer to delete everything in the Lisp buffer when you make a > > selection. > > The problem is that leaving it nil will revert to the use of > a heuristic. Fixing it right is a bit more difficult. > > > I don't understand why we need the (completely undocumented) hack > > introduced here, where the cdr of the last item on the > > completions list gives completion-base-size. Does anything else > > in Emacs depend on this? Why not simply add a new optional > > argument to display-completion-list? > > Yes the base-size in the cdr is a hack, and we be able to get > rid of it now that I've added the new `boundaries' action. But > passing it as an additional argument won't make any difference for > the bug at hand. This hack still seems to be present in the code from a build today: In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-10-03 on LENNART-69DE564 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' The cdr still seems to be used for the base size. From completion-all-completions: (let ((completion-all-completions-with-base-size t)) From completion-table-with-context: ;; In case of non-empty all-completions, ;; add the prefix size to the base-size. ((consp comp) (let ((last (last comp))) (when completion-all-completions-with-base-size (setcdr last (+ (or (cdr last) 0) (length prefix)))) comp)) From completion--file-name-table: (if (and completion-all-completions-with-base-size (consp all)) ;; Add base-size, but only if the list is non-empty. (nconc all base-size) all) This hack prevents code from treating the list as a true list - e.g. applying `length' to it. If, as you say, the hack is no longer needed and we are "able to get rid of it now", could you please remove it? Also, there is still no doc string for some of the more important functions in this library - e.g. completion-table-with-context, completion-table-with-terminator, completion-all-sorted-completions, completion-hilit-commonality, completion-basic-try-completion, completion-basic-all-completions, completion-pcm-all-completions, completion-pcm-try-completion. Likewise, no doc string for less important functions - e.g. completion--try-word-completion, minibuffer--bitset, completion--flush-all-sorted-completions, minibuffer--double-dollars, completion--make-envvar-table, completion--embedded-envvar-table, completion-emacs21-try-completion, completion-emacs21-all-completions, completion-emacs22-try-completion, completion-emacs22-all-completions, completion-pcm--prepare-delim-re, completion-pcm--pattern-trivial-p, completion-pcm--pattern->regex, completion-pcm--hilit-commonality, completion-pcm--pattern->string, completion-pcm--merge-try. Likewise, no doc string for variables - e.g. completion-all-sorted-completions, completion-common-substring, completion--embedded-envvar-re, completion-pcm--delim-wild-regex. Thx.