From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: disable linum-mode in other buffers, like eshell, compilation Date: Tue, 13 Jul 2010 02:42:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <789e696b-3bfe-4f42-8627-a747a8f77fe0@d16g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291844781 13270 80.91.229.12 (8 Dec 2010 21:46:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 21:46:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 22:46:11 2010 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.69) (envelope-from ) id 1PQRpx-0002vQ-8Y for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 22:46:09 +0100 Original-Received: from localhost ([127.0.0.1]:42085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQRpw-0000NR-HS for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 16:46:08 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!k1g2000prl.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 42 Original-NNTP-Posting-Host: 67.180.85.8 Original-X-Trace: posting.google.com 1279014137 11975 127.0.0.1 (13 Jul 2010 09:42:17 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 13 Jul 2010 09:42:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k1g2000prl.googlegroups.com; posting-host=67.180.85.8; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:179722 comp.emacs:100187 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:76071 Archived-At: On Jul 13, 2:25=C2=A0am, "z.cHris" wrote: > Hi, > > I use linum-mode almost all the time, so i use (global-linum-mode t), > but i don't want to use it in eshell mode, compilation mode, etc. in > which the line number is useless. > > And also, when i use linum-mode in eshell or compilation mode, if a > long line is printed, the cursor is paused in first lines, never > scroll screen to the end of that line. > > I use > (add-hook 'eshell-mode-hook > '(lambda () (linum-mode nil))) > > but can't work, is anyone know how to solve this problem? if you want to turn it off, you should use 0, not nil. See: =E2=80=A2 Emacs: How to Turn a Minor Mode on/off/toggle? http://xahlee.org/emacs/emacs-tip_mode_on_off_toggle.html try that see if it address the problem. If that doesn't work, i suspect it might be a bug, of the inter-relations of the global vs non- global version... instead of turning it off for particular modes, possibly more practical is to turn it on for text related modes. e.g. (defun turn-spell-checking-on () "Turn speck-mode or flyspell-mode on." (flyspell-mode 1) ) (add-hook 'text-mode-hook 'turn-spell-checking-on) Xah =E2=88=91 http://xahlee.org/ =E2=98=84