From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: :regexp to abbrev table Date: Tue, 20 Apr 2010 14:37:37 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1271771604 21533 80.91.229.12 (20 Apr 2010 13:53:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Apr 2010 13:53:24 +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 Apr 20 15:53:22 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@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 1O4Dt8-0007eT-ON for ged-emacs-devel@m.gmane.org; Tue, 20 Apr 2010 15:53:19 +0200 Original-Received: from localhost ([127.0.0.1]:44847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4Dt8-00061z-45 for ged-emacs-devel@m.gmane.org; Tue, 20 Apr 2010 09:53:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4DpE-0004Ou-1Y for emacs-devel@gnu.org; Tue, 20 Apr 2010 09:49:16 -0400 Original-Received: from [140.186.70.92] (port=50238 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4Dp9-00047a-GH for emacs-devel@gnu.org; Tue, 20 Apr 2010 09:49:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4DeM-0004RS-0f for emacs-devel@gnu.org; Tue, 20 Apr 2010 09:38:05 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:54585) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4DeL-0004R4-SK for emacs-devel@gnu.org; Tue, 20 Apr 2010 09:38:01 -0400 Original-Received: by wyg36 with SMTP id 36so8704wyg.0 for ; Tue, 20 Apr 2010 06:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JqX2g5eggmGIk7q5PdSx+vCEAGFMLlyeuu30Wuy+Z58=; b=lpRA5VsNjc/Wp4pbZHMc4IfDxX00jR96JzjGWTUdTjMpNgam/BII/REpTN3qFSvSgX wMrGk4Z/5iwTome65Y4HFgsd5VLwdwvNEbh2L/sXwT7aSQBYcfmspnZqeIPwD6SqryA8 ElfnQ8pJFSfD0CqCw0sFoA5ZR3SXcuChbiuoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sAunR7EzueZYP8u8n+6tDVGCU2ZUNJ8WQxrBqWRvJzEYNlL+Lk76lrCQsmIMHe1Rff OqnBHSmIg/eIHA3Mv2dMP5SMWfwxL059cR/U2wZDYFZn32xshG71TSvp/nx6QRh44PpJ nG4zgUMtX/IhOBrr5vVv/yBKHGpg+euGSZbFE= Original-Received: by 10.216.159.71 with HTTP; Tue, 20 Apr 2010 06:37:37 -0700 (PDT) In-Reply-To: Original-Received: by 10.216.157.1 with SMTP id n1mr3593324wek.141.1271770657793; Tue, 20 Apr 2010 06:37:37 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123912 Archived-At: On 19 April 2010 19:56, Stefan Monnier wrote: >> Is it possible for you to provide an actual regexp to find abbrevs that >> contains word, symbol or \? > > I'd start with "\\(?:^\\|[^[:word:]\\]\\)\\([[:word:]\\]+\\)[ \t]*". > For symbols, I recommend you list the chars you want in the above regexp > rather than rely on the `symbol' char syntax. Many thanks for this. I will bear this in mind when writing the abbrev completion code. Since TAB can be configured to perform two roles: indentation and completion through (setq tab-always-indent 'complete). Completion in the middle of a 'word' often lead to undesirable change of the text in buffer. For example: (emacs-lis|p-mode) where | is the cursor. TAB will change the text to (emacs-lisp-p-mode). I often type TAB to check whether current line is correctly indented and so this completion is annoying, for lisp-mode I have redefined lisp-completion-at-point to work around this problem. The same situation applies to abbrevs and the :regexp doesn't make it easy to find the 'end' boundary. >>>> Do you think using greedy looking-back in abbrev--before-point will ma= ke >>>> creating the :regexp property easier? >>> It often would, yes. =A0 But it could also negatively affect performanc= e. >> I don't know the impact on performance. But since it is capped by >> (line-beginning-position) will it matter that much? During the time I >> enabled greedy looking-back, I haven't noticed any slow down. > > Under normal circumstances, I don't expect serious performance > problems, indeed. =A0But since the code might be executed very often even > for users who will almost never use those abbrevs, we have to be careful > so it works in more cases than the expected one. > This said, I do not know if my performance worries are justified. > > > =A0 =A0 =A0 =A0Stefan Leo