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 17:32:14 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271781205 30472 80.91.229.12 (20 Apr 2010 16:33:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 20 Apr 2010 16:33:25 +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 18:33:23 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 1O4GNy-0007rA-6n for ged-emacs-devel@m.gmane.org; Tue, 20 Apr 2010 18:33:18 +0200 Original-Received: from localhost ([127.0.0.1]:45811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4GNx-0006Tj-FS for ged-emacs-devel@m.gmane.org; Tue, 20 Apr 2010 12:33:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4GN2-0005cY-FI for emacs-devel@gnu.org; Tue, 20 Apr 2010 12:32:20 -0400 Original-Received: from [140.186.70.92] (port=33319 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4GN0-0005bE-EQ for emacs-devel@gnu.org; Tue, 20 Apr 2010 12:32:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4GMy-00060y-Pa for emacs-devel@gnu.org; Tue, 20 Apr 2010 12:32:18 -0400 Original-Received: from ppsw-33.csi.cam.ac.uk ([131.111.8.133]:52170) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4GMy-00060S-Je for emacs-devel@gnu.org; Tue, 20 Apr 2010 12:32:16 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Original-Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]:59178) by ppsw-33.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1O4GMw-0002c2-Be (Exim 4.70) (return-path ); Tue, 20 Apr 2010 17:32:14 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 20 Apr 2010 11:22:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:123923 Archived-At: On 2010-04-20 16:22 +0100, Stefan Monnier wrote: >> 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). > > This is indeed a problem we need to fix: it should take the tail into > account, just as is done in the minibuffer. Try the patch below. > Of course, it will not necessarily always solve the problem that "I just > wanted to reindent and it started to complete and annoyed me". The code works fine except probably wrapping backward-sexp inside ignore-errors for the case like this (|emacs-lisp-mode). Otherwise it errs with: forward-sexp: Scan error: "Containing expression ends prematurely", 228, 228 Will you consider applying the patch to trunk? Leo