unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Questions about abbrev
@ 2008-05-01 18:35 TheLonelyStar
  0 siblings, 0 replies; 3+ messages in thread
From: TheLonelyStar @ 2008-05-01 18:35 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,
I am trying to get abbrev to work. I added this to my .emacs:

(setq abbrev-file-name "~/.emacs-config/abbrev_defs") ;; definitions from .
..
(setq save-abbrevs t)
(quietly-read-abbrev-file)
(abbrev-mode 1)
(setq default-abbrev-mode t)

Now I create a abbrev with C-x a g

Should abbrev now replace the abbrevation I just typed in?
And, when I later type the abbrevation, it is not replaced.
What am I missing?

Thanks!
Nathan
-- 
View this message in context: http://www.nabble.com/Questions-about-abbrev-tp16995004p16995004.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: Questions about abbrev
       [not found] <mailman.11033.1209666967.18990.help-gnu-emacs@gnu.org>
@ 2008-05-01 21:12 ` Xah
  2008-05-02 13:02   ` TheLonelyStar
  0 siblings, 1 reply; 3+ messages in thread
From: Xah @ 2008-05-01 21:12 UTC (permalink / raw)
  To: help-gnu-emacs

Nathan, TheLonelyStar <nab...@lonely-star.org> wrote:
«I am trying to get abbrev to work. I added this to my .emacs:»

Here's what i have. just put in your “.emacs”:

(setq save-abbrevs nil)

(define-abbrev-table 'global-abbrev-table '(
    ("tin" "∈" nil 0)
    ("tnin" "∉" nil 0)
    ("tinfinity" "∞" nil 0)

    ("luv" "♥" nil 0)

    ("twdy" "wordy-english@yahoogroups.com" nil 0)

    ("twp" "Wikipedia" nil 0)
    ("tpr" "POV-Ray" nil 0)
    ("tsl" "Second Life" nil 0)
    ("tmma" "Mathematica" nil 0)

    ("txl" "http://xahlee.org/" nil 0)

    ("tpic" "Picture\\ \\([0-9]+\\)\\.png" nil 0)

    ("tditto" "ditto -ck --sequesterRsrc " nil 0)
    ("tcvt" "convert -quality 85%" nil 0)
    ("tcvt256" "convert +dither -colors 256 " nil 0)
    ("tcvtf" "find . -name \"*png\" | xargs -l -i basename -s \".png\"
\"{}\" | xargs -l -i  convert -quality 85% \"{}.png\" \"{}.jpg\"" nil
0)

    ("tk" "kill `ps auwwx | grep -E 'Resources/TruBlueEnvironment' |
grep -v grep | awk '{print $2}'`" nil 0)

    ("t0" "find . -size 0" nil 0)
    ("t00" "find . -size 0 -exec rm {} \\;" nil 0)

    ("trsync" "rsync -z -av --exclude=\"*~\"  --exclude=\".DS_Store\"
--exclude=\".bash_history\"  --exclude=\"*/_curves_robert_yates/*.png
\" --exclude=\"logs/*\"  --exclude=\"xlogs/*\" --delete --rsh=\"ssh -l
some\" ~/web/ some@someus:~/" nil 0)
    ))

this directly setup your abbrev table, and set save-abbrevs to false.
So, it bypass emacs asking you to save it as a standard abbrev file.

oh, you also need to turn abbrev on. I have in my

(custom-set-variables
 '(abbrev-mode t)
 ...
)

«Should abbrev now replace the abbrevation I just typed in?  And, when
I later type the abbrevation, it is not replaced.  What am I missing?»

Remember, when abbrev will expand after you type space or return.

  Xah
  xah@xahlee.org
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Questions about abbrev
  2008-05-01 21:12 ` Xah
@ 2008-05-02 13:02   ` TheLonelyStar
  0 siblings, 0 replies; 3+ messages in thread
From: TheLonelyStar @ 2008-05-02 13:02 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,

Thanks for your reply, helped me a lot.
Just one problem: I have 
(setq save-abbrevs t)
in .emacs, because I define abbrevs while editing and want them to be saved
for future questions.
But I do not want to have to say y everytime I save a file.

So can I have abbrevs saved without asking?
Thanks!
Nathan
-- 
View this message in context: http://www.nabble.com/Questions-about-abbrev-tp16995004p17019064.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

end of thread, other threads:[~2008-05-02 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01 18:35 Questions about abbrev TheLonelyStar
     [not found] <mailman.11033.1209666967.18990.help-gnu-emacs@gnu.org>
2008-05-01 21:12 ` Xah
2008-05-02 13:02   ` TheLonelyStar

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).