From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: trunk r116285: * lisp/emacs-lisp/lisp.el (lisp-completion-at-point): Symbols don't start Date: Tue, 11 Feb 2014 20:42:10 -0500 Message-ID: References: <87zjm4tl2b.fsf@yandex.ru> <52F99C65.5010007@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392169347 19357 80.91.229.3 (12 Feb 2014 01:42:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Feb 2014 01:42:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 12 02:42:34 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WDOqQ-0007qJ-4H for ged-emacs-devel@m.gmane.org; Wed, 12 Feb 2014 02:42:34 +0100 Original-Received: from localhost ([::1]:36854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDOqP-00044y-Pj for ged-emacs-devel@m.gmane.org; Tue, 11 Feb 2014 20:42:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDOqG-00044p-7e for emacs-devel@gnu.org; Tue, 11 Feb 2014 20:42:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDOq8-0005TQ-Sl for emacs-devel@gnu.org; Tue, 11 Feb 2014 20:42:24 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:44672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDOq8-0005TI-P0 for emacs-devel@gnu.org; Tue, 11 Feb 2014 20:42:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpaAU/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAsOJhIUGA0kiB4GsR+QDo0ag3ADiGGcGYFegxWBSQ X-IPAS-Result: Av4EABK/CFFFpaAU/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAsOJhIUGA0kiB4GsR+QDo0ag3ADiGGcGYFegxWBSQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="47365757" Original-Received: from 69-165-160-20.dsl.teksavvy.com (HELO pastel.home) ([69.165.160.20]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Feb 2014 20:42:15 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id BAD6C602E2; Tue, 11 Feb 2014 20:42:10 -0500 (EST) In-Reply-To: <52F99C65.5010007@yandex.ru> (Dmitry Gutov's message of "Tue, 11 Feb 2014 05:43:33 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169541 Archived-At: >> Yes, except that "a quote before BEG" is not sufficient. >> We could/should also check if one of the parent open-parens is prefixed >> with a quote or a backquote, and only allow boundp if not. > Ok to install? Let's keep it for after 24.4. It's clearly a new feature, and I don't see any hurry to implement it. > +(defun lisp--form-quoted-p () > + "Return non-nil if the form after point is not evaluated. > +It can be quoted, or be inside a quoted form. > +This function moves point." > + ;; FIXME: Do some macro expansion maybe. > + (or (eq (char-after) ?\[) > + (progn > + (skip-chars-backward " ") > + (memq (char-before) '(?' ?`))) > + (and (not (eq (char-before) ?,)) > + (ignore-errors > + (up-list -1) > + (lisp--form-quoted-p))))) I think we'd want to use (nth 9 (syntax-ppss)) rather than up-list (it's got the start pos of all enclosing lists in ). Using syntax-ppss should also help us handle the case we're inside a comment/string. > `defadvice', ideally, would have to be handled specially anyway, to limit > completions to functions. Yes. And `function' (aka #') should only complete functions as well. Stefan