From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#7147: 24.0.50; M-: minibuffer completion chokes at `:' Date: Sat, 09 Oct 2010 17:46:58 +0200 Message-ID: References: <874od43geg.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286640733 15962 80.91.229.12 (9 Oct 2010 16:12:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Oct 2010 16:12:13 +0000 (UTC) Cc: 7147@debbugs.gnu.org, rfrancoise@debian.org To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 09 18:12:12 2010 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.69) (envelope-from ) id 1P4c1r-0004wQ-LI for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Oct 2010 18:12:12 +0200 Original-Received: from localhost ([127.0.0.1]:44870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4c1q-0007oO-ML for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Oct 2010 12:12:10 -0400 Original-Received: from [140.186.70.92] (port=42437 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4c1f-0007mg-Ks for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 12:12:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4c1e-00043l-78 for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 12:11:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4c1e-00043e-2r for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 12:11:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P4bac-0005zq-0w; Sat, 09 Oct 2010 11:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Oct 2010 15:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7147 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7147-submit@debbugs.gnu.org id=B7147.128663900823041 (code B ref 7147); Sat, 09 Oct 2010 15:44:01 +0000 Original-Received: (at 7147) by debbugs.gnu.org; 9 Oct 2010 15:43:28 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4ba3-0005za-Sy for submit@debbugs.gnu.org; Sat, 09 Oct 2010 11:43:28 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4ba1-0005zS-9l for 7147@debbugs.gnu.org; Sat, 09 Oct 2010 11:43:26 -0400 Original-Received: from dyn.144-85-184-059.dsl.vtx.ch ([144.85.184.59]:15351 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P4bdE-0006bp-4u; Sat, 09 Oct 2010 11:46:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 218B96610C; Sat, 9 Oct 2010 17:46:58 +0200 (CEST) In-Reply-To: <874od43geg.fsf@gmail.com> ("=?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?="'s message of "Sat, 02 Oct 2010 14:53:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 09 Oct 2010 11:44:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:40787 Archived-At: > Steps to reproduce: > emacs -Q > (defun too:bad () nil) > M-: (too M-TAB > => lists completions including `too:bad' > M-: (too: M-TAB > => [Nothing to complete] Thanks. A similar problem exists in Emacs-23, tho with slightly less severe symptoms. I've checked the fix below in emacs-23 which will propagate to trunk soonish. Please confirm when it is fixed, Stefan === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-09 10:51:42 +0000 +++ lisp/ChangeLog 2010-10-09 15:41:56 +0000 @@ -1,3 +1,8 @@ +2010-10-09 Stefan Monnier + + * emacs-lisp/lisp.el (lisp-completion-at-point): + Use emacs-lisp-mode-syntax-table for the whole function. + 2010-10-09 Richard Sharman (tiny change) * progmodes/gdb-ui.el (gdb-mouse-toggle-breakpoint-margin) === modified file 'lisp/emacs-lisp/lisp.el' --- lisp/emacs-lisp/lisp.el 2010-04-20 07:54:28 +0000 +++ lisp/emacs-lisp/lisp.el 2010-10-09 15:37:41 +0000 @@ -632,13 +632,13 @@ (defun lisp-completion-at-point (&optional predicate) "Function used for `completion-at-point-functions' in `emacs-lisp-mode'." ;; FIXME: the `end' could be after point? + (with-syntax-table emacs-lisp-mode-syntax-table (let* ((end (point)) - (beg (with-syntax-table emacs-lisp-mode-syntax-table - (save-excursion + (beg (save-excursion (backward-sexp 1) (while (= (char-syntax (following-char)) ?\') (forward-char 1)) - (point)))) + (point))) (predicate (or predicate (save-excursion @@ -653,7 +653,7 @@ (eq (char-after) ?\()) (error nil)) ;; If the first element of the parent list is an open - ;; parenthesis we are probably not in a funcall position. + ;; paren we are probably not in a funcall position. ;; Maybe a `let' varlist or something. nil ;; Else, we assume that a function name is expected. @@ -662,7 +662,7 @@ :predicate predicate :annotate-function (unless (eq predicate 'fboundp) - (lambda (str) (if (fboundp (intern-soft str)) " ")))))) + (lambda (str) (if (fboundp (intern-soft str)) " "))))))) ;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e ;;; lisp.el ends here