From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: lisp-completion-at-point "end" position. Date: Tue, 02 Aug 2011 06:58:55 +0200 Message-ID: <87mxfsv27k.fsf@gmail.com> References: <8762my2qwu.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1312261151 21965 80.91.229.12 (2 Aug 2011 04:59:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Aug 2011 04:59:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 02 06:59:07 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qo74N-00050j-LZ for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2011 06:59:07 +0200 Original-Received: from localhost ([::1]:46642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo74M-0008Jc-Sn for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2011 00:59:06 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo74J-0008J6-Mb for emacs-devel@gnu.org; Tue, 02 Aug 2011 00:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qo74H-0000mk-O8 for emacs-devel@gnu.org; Tue, 02 Aug 2011 00:59:03 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:62413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qo74H-0000mN-A8 for emacs-devel@gnu.org; Tue, 02 Aug 2011 00:59:01 -0400 Original-Received: by wyg36 with SMTP id 36so2415786wyg.0 for ; Mon, 01 Aug 2011 21:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=HmoGmvRrkaoPzEW3grqGy9hMkjTQsAH/hyDToo4ZfCI=; b=d7QnStyrEtdv2S16BH4rB1mWgsb+/yE9hDSTCNZ4lF3qtG0imU3mKZrMj3rGnQvJ/3 QNR1KT305HiIR6JkwahAjC2PFt4vm1FcOCsm9W0GPgNBOTh+XtAoF8qQMGb9G13ZXiu+ wjm9mtz/t/+JN6X2KmlwHztQ4r7vNtp5Obl2c= Original-Received: by 10.216.154.138 with SMTP id h10mr1543384wek.39.1312261139646; Mon, 01 Aug 2011 21:58:59 -0700 (PDT) Original-Received: from thierry-MM061 (82.211.85.79.rev.sfr.net [79.85.211.82]) by mx.google.com with ESMTPS id m56sm3750363wed.11.2011.08.01.21.58.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Aug 2011 21:58:58 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 01 Aug 2011 22:50:25 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 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:142674 Archived-At: Stefan Monnier writes: >> If i complete:(note that there is no space between "!" and "s") >> (def!some_text > >> The value of beg is the value of point at "d" >> The value of end is the value of point at "t" > > Yes, so you can do complete (wit!sel to (with-selected-. > Whether that is done or not will depend on completion-styles, where the > difference between `basic', `emacs22', and `emacs21' is exactly about > what to do in such a case. It seem these completion-styles work when using completion-at-point, but not when using directly lisp-completion-at-point and i see nothing here taking care of this: --8<---------------cut here---------------start------------->8--- (end (unless (or (eq beg (point-max)) (member (char-syntax (char-after beg)) '(?\" ?\( ?\)))) (condition-case nil (save-excursion (goto-char beg) (forward-sexp 1) (when (>= (point) pos) (point))) (scan-error pos))))) --8<---------------cut here---------------end--------------->8--- So (let ((completion-styles 'emacs22)) (lisp-completion-at-point)) (let ((completion-styles 'partial-completion)) (lisp-completion-at-point)) (let ((completion-styles 'basic)) (lisp-completion-at-point)) Returns the same value. But well, it's ok i use always the value of `point' here instead of (cadr lisp-completion-at-point). >> Is there a good reason for that? > > I'll let you judge whether it's good or not. But it's the same behavior > as in the minibuffer. It's inconvenient to have to type a space just to have completion. e.g: (def!(something) => doesn't complete def (def! (something) => complete def -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997