From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#591: 23.0.60; lisp-complete-symbol erases extra text Date: Tue, 29 Jul 2008 16:46:16 -0400 Message-ID: <87ej5czaef.fsf@stupidchicken.com> Reply-To: Chong Yidong , 591@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217365668 15351 80.91.229.12 (29 Jul 2008 21:07:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Jul 2008 21:07:48 +0000 (UTC) Cc: 591@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 29 23:08:38 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 1KNwQn-0001We-VS for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Jul 2008 23:08:30 +0200 Original-Received: from localhost ([127.0.0.1]:43604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNwPt-0008OT-G4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Jul 2008 17:07:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNwPn-0008OH-Cc for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2008 17:07:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNwPl-0008Na-3j for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2008 17:07:26 -0400 Original-Received: from [199.232.76.173] (port=34217 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNwPk-0008NQ-V4 for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2008 17:07:25 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35557) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KNwPk-0001Nb-BA for bug-gnu-emacs@gnu.org; Tue, 29 Jul 2008 17:07:24 -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 m6TL7KtV018044; Tue, 29 Jul 2008 14:07:21 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6TKo3ec012741; Tue, 29 Jul 2008 13:50:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 29 Jul 2008 20:50:03 +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.121736426911484 (code B ref 591); Tue, 29 Jul 2008 20:50:03 +0000 Original-Received: (at 591) by emacsbugs.donarmstrong.com; 29 Jul 2008 20:44:29 +0000 Original-Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6TKiM04011478 for <591@emacsbugs.donarmstrong.com>; Tue, 29 Jul 2008 13:44:23 -0700 Original-Received: by cyd (Postfix, from userid 1000) id 1E42857E330; Tue, 29 Jul 2008 16:46:16 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Tue, 29 Jul 2008 17:07:26 -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:18914 Archived-At: > emacs -Q > > In *scratch*, type this, and leave cursor after the final `for': > > format-decode-buffer > forward-char > > for > > Then hit `M-TAB'. Choose one of the completions using mouse-2 in *Completions*. > > Only the final `for' should be completed, but instead all of the text > in the buffer is replaced by the chosen completion. Hi Stefan, This bug was introduced by your patch: 2008-04-13 Stefan Monnier minibuffer.el (display-completion-list): Handle all-completions's new base-size info to set completion-base-size. (with-current-buffer standard-output ... (insert "Possible completions are:\n") (let ((last (last completions))) ;; Get the base-size from the tail of the list. (set (make-local-variable 'completion-base-size) (or (cdr last) 0)) (setcdr last nil)) ;Make completions a properly nil-terminated list. (completion--insert-strings completions)))) This sets completion-base-size to 0, which causes the completions buffer to delete everything in the Lisp buffer when you make a selection. 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?