From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: About abbrevs and spaces at end of line Date: Tue, 10 Dec 2013 09:07:43 +0100 Message-ID: <52A6CBCF.2010506@easy-emacs.de> References: <87r49lg0j6.fsf@newsguy.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1386662691 10517 80.91.229.3 (10 Dec 2013 08:04:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2013 08:04:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 10 09:04:57 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1VqIJM-0007A3-Je for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Dec 2013 09:04:56 +0100 Original-Received: from localhost ([::1]:47765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqIJM-0002wa-6J for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Dec 2013 03:04:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqIJ4-0002vO-O2 for help-gnu-emacs@gnu.org; Tue, 10 Dec 2013 03:04:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqIIx-0001Pe-Ey for help-gnu-emacs@gnu.org; Tue, 10 Dec 2013 03:04:38 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:63169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqIIx-0001PU-3l for help-gnu-emacs@gnu.org; Tue, 10 Dec 2013 03:04:31 -0500 Original-Received: from purzel.sitgens (brln-4d0c096d.pool.mediaWays.net [77.12.9.109]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MCdVO-1VgyeF2i26-0096qS; Tue, 10 Dec 2013 09:04:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: <87r49lg0j6.fsf@newsguy.com> X-Provags-ID: V02:K0:9d1Eni6KuoRV6+lV5gjvQzv08+9HMpQGpXfGMrbCqWM vvWJoB9qvM6KUVW2czsUufBPMd070lOpzB3xMpWxWjPkXAUCwQ pLuKKj1CKnyyYyFuOo+fPKc1D3UqWn0ox8qtCXtGgadweX6ReK XrZRcKT4oW3cpuJu4mPok87rouhz+mY5Jco+ZhEJlB3NrVOog1 R7iZrBPAwqSUk+bNCQ+LWXdh/AuHEZJSMC2Dde5enXxoa1dbR3 ZaJ6dmS/ujwwOjNmNbUyzqiJY+M+b1Gg06ZiEtLOIfVQ5pveA7 Z2qIAGqJa8loZroh+5ks/3XTTg1Pht9jt+tg3jOGvJeZH/Q76d 1N+KDTdTEBhV1U+rp8Mc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.126.187 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94919 Archived-At: Am 09.12.2013 22:46, schrieb Harry Putnam: > Is there some smooth way to avoid having a space at the end of line > when activating an abbrev as the last thing done before newline? > > For example: I have `tru' (in Cperl abbrev table) set like so > tru "\"TRUE\";" > > Which enters "TRUE"; (If I invoked it with the space bar) > > I can avoid it by using an using the RET bar and leaving a > newline. > > But when editing perl code, I often am working between {} where a > stray newline will leave an unsightly empty line in a clump of code. > > Using the space bar to invoke (when in cperl-mode and many other > modes) leaves my code with what appears to be underscores (_) showing > where the spc is. > > I'm not real sure where they come from. They are not really > underscores, but markers left by the editor(?) that do not appear if > you print it (I guess). Any way, that is another matter for a > different thread. > > The short and long is: Invoking with spc leaves unsightly marks like > an underscore if done at the end of a line and invoking with is > not always desirable if a new line is not needed. > > Before I tangle myself up any further.... I'd like to know if there is > a smooth way to create an abbrev that somehow avoids leaving that spc > that was used to invoke it. Somehow backing the cursor up 1 space > after invocation or the like. > > I can do it by creating an elisp 'skeleton' that does the job by using > the proper code to control where the cursor lands, and then associating > that 'skeleton' to my 'tru' abbrev in the cperl-table. Yes. that > works, but requires a fair bit of typing to create. > > I'd need to edit .emacs to type out the 'skeleton' (or some other > sourced file) and then the abbrev table to type out the linked abbrev. > > ------- --------- ---=--- --------- -------- > > I have visions of some tricky way of setting up an abbrev with hardly > any more effort than the normal > > M-x edit-abbrevs > > "tru" 0 "\"TRUE\";" > > In the cperl-table, then pressing C-c > > Where I only need to edit the cperl abbrev table. > > > > Problem results from binding abbrev-expand to SPACE. Abbrev is expanded, than SPACE is inserted, as you typed it. Solution: abbrev-mode off. Use any other key to M-x expand-abbrev RET. This will expand it, but not insert a space. Andreas