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

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

Re: turning line mode on/off with defun not working


From: Emanuel Berg
Subject: Re: turning line mode on/off with defun not working
Date: Fri, 06 Dec 2013 22:42:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Emanuel Berg <embe8573@student.uu.se> writes:

> In that case, let me tell you some more. Those
> interactive defuns are handy for situations unforeseen,
> when you suddenly need them. But for certain modes, you
> know you always want it (or you know you never want
> it). In those cases you can set (or unset)
> automatically upon invocation, with hooks. Those hooks
> do the job for you in 99% of the cases, and in the 1%
> case, you still have those interactive defuns to set it
> manually.
>
> So to enable line-number-mode for C and C++
> programming, it may look like this:
>
> (setq c-mode-hook 'lines)
> (setq c++-mode-hook (lambda () (lines) (abbrev-mode 0)))
>
> In C++, I also disable abbrev-mode (for some reason),
> but it is only a good thing because as you see,
> enabling line-number-mode looks somewhat
> different. Note that the above are for my lines stuff -
> to use the actual functions directly, probably you need
> (lambda () (line-number-mode 1)) for the modes where
> you want it.

No, that seems not to be local (?). Well, the way I did
it with `lines' above, that works, so use that if you
want it the way I describe it.

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


reply via email to

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