From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: turning line mode on/off with defun not working
Date: Fri, 06 Dec 2013 22:42:49 +0100 [thread overview]
Message-ID: <87lhzxodu5.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: 87ppp93bnv.fsf@nl106-137-194.student.uu.se
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
next prev parent reply other threads:[~2013-12-06 21:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.8198.1386264536.10748.help-gnu-emacs@gnu.org>
2013-12-06 18:35 ` turning line mode on/off with defun not working Emanuel Berg
2013-12-06 19:21 ` Wes James
[not found] ` <mailman.8418.1386360511.10748.help-gnu-emacs@gnu.org>
2013-12-06 21:35 ` Emanuel Berg
2013-12-06 21:42 ` Emanuel Berg [this message]
2013-12-06 22:35 ` Emanuel Berg
2013-12-06 23:05 ` Wes James
2013-12-06 23:16 ` Emanuel Berg
2013-12-07 9:06 ` PJ Weisberg
[not found] ` <mailman.8440.1386407185.10748.help-gnu-emacs@gnu.org>
2013-12-07 13:28 ` Emanuel Berg
2013-12-05 18:42 Wes James
2013-12-05 18:48 ` Drew Adams
2013-12-05 19:00 ` Wes James
-- strict thread matches above, loose matches on Subject: below --
2013-12-05 17:28 Wes James
2013-12-05 17:31 ` Drew Adams
2013-12-05 17:54 ` Wes James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhzxodu5.fsf@nl106-137-194.student.uu.se \
--to=embe8573@student.uu.se \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).