help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I turn on abbrev mode by default?


From: Micah Cowan
Subject: Re: How can I turn on abbrev mode by default?
Date: 19 Oct 2003 01:47:11 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

jan <janmar@iprimus.com.au> writes:

> Dan Anderson <dan@mathjunkies.com> writes:
> 
> > > Go to the customization for cperl-mode-hook by doing:
> > > 
> > >   M-x customize-option RET cperl-mode-hook
> > > 
> > > Then click on INS and type into the field:
> > > 
> > >   abbrev-mode
> > 
> > When I do that it tells me "No match".  CPerlmode is installed in my
> > .emacs.d/lisp directory.  Could this be the problem?
> 
> Another approach is to just add this to your .emacs file.
> 
> (add-hook 'hack-local-variables-hook
>         #'(lambda ()
>             (when (eq major-mode 'cperl-mode)
>               (abbrev-mode 1))))

It seems more appropriate to do

  (add-hook 'cperl-mode-hook 'abbrev-mode)

or maybe

  (add-hook 'cperl-mode-hook #'(lambda () (abbrev-mode 1)))

> 
> But why not turn it on all the time. Abbrevs are mode sensitive
> anyway. It's even simpler too.
> 
> (add-hook 'hack-local-variables-hook
>         #'(lambda () (abbrev-mode 1)))

If that's truly what you want... This seems too much like a
shotgun-approach to me, tho': if you find yourself using it in
most of your modes, then maybe having an alist of modes to
either enable or disable it in might be slightly better...

Just my 2ยข
-Micah


reply via email to

[Prev in Thread] Current Thread [Next in Thread]