From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#1797: 23.0.60; completing-read breaks backwards compatibility Date: Mon, 05 Jan 2009 23:24:54 -0500 Message-ID: References: <18786.40315.242106.507079@a1ihome1.kph.uni-mainz.de> Reply-To: Stefan Monnier , 1797@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 1231217022 22729 80.91.229.12 (6 Jan 2009 04:43:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2009 04:43:42 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 1797@emacsbugs.donarmstrong.com To: Ulrich Mueller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 06 05:44:53 2009 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 1LK3oB-0001QT-5K for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Jan 2009 05:44:51 +0100 Original-Received: from localhost ([127.0.0.1]:42256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LK3mv-0000XC-JH for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Jan 2009 23:43:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LK3mr-0000Wz-QC for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 23:43:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LK3mq-0000Wb-9Y for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 23:43:29 -0500 Original-Received: from [199.232.76.173] (port=55811 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LK3mq-0000WX-1o for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 23:43:28 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50316) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LK3mp-0005iP-Fx for bug-gnu-emacs@gnu.org; Mon, 05 Jan 2009 23:43:27 -0500 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 n064hNTd015694; Mon, 5 Jan 2009 20:43:24 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n064U4et012187; Mon, 5 Jan 2009 20:30:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 06 Jan 2009 04:30:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1797 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1797-submit@emacsbugs.donarmstrong.com id=B1797.123121590410973 (code B ref 1797); Tue, 06 Jan 2009 04:30:03 +0000 Original-Received: (at 1797) by emacsbugs.donarmstrong.com; 6 Jan 2009 04:25:04 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n064P0gk010836 for <1797@emacsbugs.donarmstrong.com>; Mon, 5 Jan 2009 20:25:01 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMEAK9rYknO+JnM/2dsb2JhbACBbMxghXKBaQ X-IronPort-AV: E=Sophos;i="4.36,334,1228107600"; d="scan'208";a="31835130" Original-Received: from 206-248-153-204.dsl.teksavvy.com (HELO ceviche.home) ([206.248.153.204]) by ironport2-out.teksavvy.com with ESMTP; 05 Jan 2009 23:24:54 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 42482B41B8; Mon, 5 Jan 2009 23:24:54 -0500 (EST) In-Reply-To: <18786.40315.242106.507079@a1ihome1.kph.uni-mainz.de> (Ulrich Mueller's message of "Tue, 6 Jan 2009 00:53:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 05 Jan 2009 23:43:29 -0500 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:23813 gmane.emacs.pretest.bugs:23621 Archived-At: >> The intention is for it to 100% backwards compatible. So please >> report this bug. > Here we go. > To reproduce the problem, eval the following code: Thanks. I installed a change which I believe should fix this bug. Note that your completion function is a prime example of a completion table that needs completion-boundaries in order to work right. E.g. with the function as it is defined, the *Completions* buffer has several bugs: clicking on "bar" will replace "foo ba" with "bar" rather than with "foo bar", and the completions-common-part hilighting is incorrect. If you add the code below: > (defun my-complete (s pred mode) > (string-match "^\\(.*\\s-\\)?\\(.*\\)$" s) > (let* ((s1 (match-string 1 s)) > (s2 (match-string 2 s)) > (c2 (funcall > (cond ((null mode) 'try-completion) > ((eq mode t) 'all-completions) > ((eq mode 'lambda) > (if (fboundp 'test-completion) > 'test-completion > ;; XEmacs doesn't have test-completion > (lambda (&rest args) > (eq (apply 'try-completion args) t)))) ((eq (car-safe mode) 'boundaries) (lexical-let* ((suffix (cdr mode)) (start (or (match-end 1) 0)) (end (string-match "\\s-" suffix))) (lambda (s table pred) `(boundaries ,start . ,end)))) > (t 'ignore)) > s2 > (mapcar (lambda (x) (list (concat x " "))) > my-keywords) > pred))) > (if (stringp c2) (concat s1 c2) c2))) You'll see that the completions-common-part highlighting is correct, and you can even complete "fo ba" to "foo ba" if point is after "fo" when you hit TAB. Stefan