unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* abbreviations
@ 2002-08-06 20:43 David Ellis
  2002-08-12 16:09 ` abbreviations Fernando Dobladez
  0 siblings, 1 reply; 4+ messages in thread
From: David Ellis @ 2002-08-06 20:43 UTC (permalink / raw)


I would like to set up emacs so that when I type "if " then I get
if () {
}

with the point between the 2 parens.  What is the best way to do this.

Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: abbreviations
  2002-08-06 20:43 abbreviations David Ellis
@ 2002-08-12 16:09 ` Fernando Dobladez
  0 siblings, 0 replies; 4+ messages in thread
From: Fernando Dobladez @ 2002-08-12 16:09 UTC (permalink / raw)
  Cc: help-gnu-emacs

See the 'tempo' package. Allows that and much more.

Fer


David Ellis wrote:

> I would like to set up emacs so that when I type "if " then I get
> if () {
> }
>
> with the point between the 2 parens.  What is the best way to do this.
>
> Dave
>
>
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* abbreviations
@ 2008-10-17 12:13 Joubert
  2008-10-18  6:37 ` abbreviations Ross A. Laird
  0 siblings, 1 reply; 4+ messages in thread
From: Joubert @ 2008-10-17 12:13 UTC (permalink / raw)
  To: help-gnu-emacs

I followed the instructions at the bottom of the page 

http://www.acm.caltech.edu/~astern/

but I don't see my abbreviations autocompleting or anything at all for 
that matter.

my ctrl -h v load-path returns:

Its value is 
("/usr/local/share/emacs/site-lisp/auctex" "/usr/share/emacs22/site-lisp/
dictionaries-common" "/usr/share/emacs/site-lisp/autoconf" "/etc/emacs22" 
"/etc/emacs" "/usr/local/share/emacs/22.1/site-lisp" "/usr/local/share/
emacs/site-lisp" "/usr/share/emacs/22.1/site-lisp" "/usr/share/emacs/22.1/
site-lisp/auctex" "/usr/share/emacs/22.1/site-lisp/dictionaries-common" "/
usr/share/emacs/site-lisp" "/usr/share/emacs/22.1/leim" "/usr/share/
emacs/22.1/lisp" "/usr/share/emacs/22.1/lisp/url" "/usr/share/emacs/22.1/
lisp/textmodes" "/usr/share/emacs/22.1/lisp/progmodes" "/usr/share/
emacs/22.1/lisp/play" "/usr/share/emacs/22.1/lisp/obsolete" "/usr/share/
emacs/22.1/lisp/net" "/usr/share/emacs/22.1/lisp/mh-e" "/usr/share/
emacs/22.1/lisp/mail" "/usr/share/emacs/22.1/lisp/language" "/usr/share/
emacs/22.1/lisp/international" "/usr/share/emacs/22.1/lisp/gnus" "/usr/
share/emacs/22.1/lisp/eshell" "/usr/share/emacs/22.1/lisp/erc" "/usr/
share/emacs/22.1/lisp/emulation" "/usr/share/emacs/22.1/lisp/emacs-lisp" 
"/usr/share/emacs/22.1/lisp/calendar" "/usr/share/emacs/22.1/lisp/calc" "/
usr/share/emacs/22.1/leim")

Can anybody tell me where I should put the abbrev.el file or what is the 
problem? 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: abbreviations
  2008-10-17 12:13 abbreviations Joubert
@ 2008-10-18  6:37 ` Ross A. Laird
  0 siblings, 0 replies; 4+ messages in thread
From: Ross A. Laird @ 2008-10-18  6:37 UTC (permalink / raw)
  To: help-gnu-emacs

Joubert <iamsoooawesome@yahoo.com> writes:

> but I don't see my abbreviations autocompleting or anything at all for 
> that matter.

Here's what I do (this may not be the best way to do it...):

I have a file called .abbrev_defs (it can be called anything).
In my .emacs file, I have this:

(setq-default abbrev-mode t)
(read-abbrev-file "~/.abbrev_defs")

I put my abbreviations in this file, eg:

(define-abbrev-table 'global-abbrev-table '(    (

    ("recieving" "receiving" nil 1)
    ("occurence" "occurrence" nil 1)
    ("recieves" "receives" nil 1)
    ("downlaod" "download" nil 1)
    ("recieve" "receive" nil 2)
    ("recieved" "received" nil 1)


    ))

You can also use various keys to add abbreviations (from the info file
for autocomplete):

`C-x a g'
     Define an abbrev, using one or more words before point as its
     expansion (`add-global-abbrev').

`C-x a l'
     Similar, but define an abbrev specific to the current major mode
     (`add-mode-abbrev').

`C-x a i g'
     Define a word in the buffer as an abbrev
     (`inverse-add-global-abbrev').

`C-x a i l'
     Define a word in the buffer as a mode-specific abbrev
     (`inverse-add-mode-abbrev').

And:

`M-x write-abbrev-file <RET> FILE <RET>'
     Write a file FILE describing all defined abbrevs.

`M-x read-abbrev-file <RET> FILE <RET>'
     Read the file FILE and define abbrevs as specified therein.

`M-x quietly-read-abbrev-file <RET> FILE <RET>'
     Similar but do not display a message about what is going on.


This works well for me.

Cheers.

Ross


-- 
Ross A. Laird, PhD
www.rosslaird.info





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-18  6:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 12:13 abbreviations Joubert
2008-10-18  6:37 ` abbreviations Ross A. Laird
  -- strict thread matches above, loose matches on Subject: below --
2002-08-06 20:43 abbreviations David Ellis
2002-08-12 16:09 ` abbreviations Fernando Dobladez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).