home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!ames!pacbell.com!pacbell!oracle!unrepliable!bounce
- Newsgroups: gnu.emacs.help
- From: wmesard@tofu.oracle.com (Wayne Mesard)
- Subject: Re: Can I expand an abbrev without the space getting added on the end ?
- In-Reply-To: glenn@prl.philips.co.uk's message of 3 Sep 92 11:45:31 GMT
- Message-ID: <WMESARD.92Sep4121833@tofu.oracle.com>
- Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
- Nntp-Posting-Host: tofu.us.oracle.com
- Organization: /home/wmesard/.organization
- References: <1723@prlhp1.prl.philips.co.uk>
- Date: Fri, 4 Sep 1992 20:18:33 GMT
- X-Disclaimer: This message was written by an unauthenticated user
- at Oracle Corporation. The opinions expressed are those
- of the user and not necessarily those of Oracle.
- Lines: 33
-
- glenn@prl.philips.co.uk (Glenn Coombs) writes:
- > I have just written the following bit of code:
- >
- > (defun magic-main ()
- > "insert a main () construct automatically"
- > (beginning-of-line) ; put main at margin
- > (delete-horizontal-space)
- > (end-of-line)
- > (insert-string "\n{\n\t\n}")
- > (search-backward ")"))
- >
- > (define-abbrev c-mode-abbrev-table "main" "main ()" 'magic-main)
-
- > the
- > space that I type after main in order to get it expanded gets added
- > in after the expansion call has been executed.
- [...]
- > and I have to manually delete a space. Does anyone know of a way to
- > stop this space from appearing or a way to work round it ?
-
- The insertion of the character you type is the very last thing that
- happens during the abbrev-expansion procedure and there's no opportunity
- for client elisp code to suppress that.
-
- If you explicitly expand the abbrev via "Control-x '" you won't get an
- extra space. I suggest you do that. Also, if you type some other
- character to get the abbrev expanded, such as a comma, then you'll get
- that character instead of the Space.
-
- There is no over way around this. Believe me, I've tried.
- --
- Wayne();
- WMesard@us.Oracle.COM
-