From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: turning line mode on/off with defun not working Date: Fri, 06 Dec 2013 22:42:49 +0100 Organization: Aioe.org NNTP Server Message-ID: <87lhzxodu5.fsf@nl106-137-194.student.uu.se> References: <87iov1vnd2.fsf@nl106-137-194.student.uu.se> <87ppp93bnv.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1386366317 18876 80.91.229.3 (6 Dec 2013 21:45:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Dec 2013 21:45:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 22:45:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vp3D7-0003V8-Q8 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 22:45:21 +0100 Original-Received: from localhost ([::1]:33607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vp3D7-00050R-Bi for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Dec 2013 16:45:21 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!news.stack.nl!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: VVbyYd/iFZoeWNmD9i++cQ.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:epD+ESI7YDSv6ib3KCuHWUxsUqA= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:202591 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94860 Archived-At: Emanuel Berg 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