From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Does emacs have a line numbering feature? Date: Sun, 9 Sep 2007 15:58:54 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1189380010 27581 80.91.229.12 (9 Sep 2007 23:20:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2007 23:20:10 +0000 (UTC) To: "Michael Trausch" <"mike|s/\\x40/\\./g; s/|.*|/\\x40/g; |trausch"@us.oracle.com>, Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 10 09:19:56 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IUdFi-0005jz-TY for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Sep 2007 09:00:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUVlM-0005r3-LO for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Sep 2007 19:00:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUVka-0005eL-4t for help-gnu-emacs@gnu.org; Sun, 09 Sep 2007 18:59:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUVkY-0005dS-D7 for help-gnu-emacs@gnu.org; Sun, 09 Sep 2007 18:59:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUVkY-0005dK-2M for help-gnu-emacs@gnu.org; Sun, 09 Sep 2007 18:59:30 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IUVkX-00035o-LP for help-gnu-emacs@gnu.org; Sun, 09 Sep 2007 18:59:29 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l89MxRCf031288 for ; Sun, 9 Sep 2007 17:59:27 -0500 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l89MxQDV014223; Sun, 9 Sep 2007 16:59:26 -0600 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-187.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 3197309701189378729; Sun, 09 Sep 2007 15:58:49 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-reply-to: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:47417 Archived-At: > >>> (setq line-number-mode t) > >>> (setq column-number-mode t) > >> Yeah, I already had that in, and it works. However, if I do something > >> similar for linum-mode, it seems to just ignore it. > > > > Yes, because setting a minor mode variable to activate it is the wrong > > thing to do. It might work sometimes, but generally you should either > > customize the variable or use the minor mode function. So the code > > above should better be > > > > (line-number-mode 1) > > (column-number-mode 1) > > > > because by convention a minor mode is turned on if the argument is > > positive. > > > > Okay... I tried that, too, for linum-mode, and it doesn't work. Am I > missing something obvious or am I an idiot? :-P Linum mode is a local minor mode: turning it on does so only for the current buffer. Are you using Emacs 22? If so, then you can define a different command, `global-linum-mode', as follows (after loading linum.el): (define-globalized-minor-mode global-linum-mode linum-mode (lambda nil (linum-mode 1))) Then just put this in your .emacs: (global-linum-mode 1). You can toggle line numbering in all buffers at once using command `global-linum-mode'. Even the minibuffer is affected, which might not be what you want. You might ask Markus to add this command to the library. If you don't have Emacs 22, then you will probably need to turn on the (local) mode in each buffer, using a hook. HTH.