all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* About abbrevs and spaces at end of line
@ 2013-12-09 21:46 Harry Putnam
  2013-12-10  8:07 ` Andreas Röhler
  0 siblings, 1 reply; 9+ messages in thread
From: Harry Putnam @ 2013-12-09 21:46 UTC (permalink / raw)
  To: help-gnu-emacs

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";<spc> (If I invoked it with the space bar)

I can avoid it by using an <ENTER> 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 <RET> 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 <RET>

   "tru"       0          "\"TRUE\";"

In the cperl-table, then pressing C-c

Where I only need to edit the cperl abbrev table.
 




^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <mailman.8702.1386625654.10748.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2013-12-11 20:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 21:46 About abbrevs and spaces at end of line Harry Putnam
2013-12-10  8:07 ` Andreas Röhler
2013-12-10 11:08   ` Harry Putnam
2013-12-10 11:47     ` Andreas Röhler
2013-12-10 11:53       ` Matthias Pfeifer
2013-12-11 12:29       ` Harry Putnam
2013-12-11 13:03         ` Andreas Röhler
     [not found] <mailman.8702.1386625654.10748.help-gnu-emacs@gnu.org>
2013-12-11 20:54 ` duthen.mac.01
2013-12-11 20:55 ` duthen.mac.01

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.