You are not logged in.

#1 2010-04-05 13:00:14

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

Emacs & linum-mode

I'm now to emacs and wanted line numbers on the side of each frame to load automaticaly on emacs start.

If I run M+x global-linum-mode from inside emacs - it works like a charm.

So, I tried putting (global-linum-mode) and/or (global-linum-mode 1) to .emacs file but when I start emacs, line numbers don't load. If I then issue M+x global-linum-mode first it says "Global-linum-mode disabled." while it never actually was enabled (or at least didn't show any results)... and then when I issue the same command again, then the line numbers finaly show up.. WUT?

I don't know if I'm doing something wrong or is it a bug or what, but could someone please point me into right direction?

Thank you smile


...I put on my robe and a wizard hat...

Offline

#2 2010-04-05 13:51:07

ZaQ
Member
Registered: 2009-12-12
Posts: 106

Re: Emacs & linum-mode

-- Wrong post --

sorry

Last edited by ZaQ (2010-04-05 20:03:19)

Offline

#3 2010-04-05 13:59:05

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Emacs & linum-mode

'(global-linum-mode 1)' should work without problem and does for me on a recent bzr checkout.  Could you try with emacs-otf or emacs-bzr from AUR and see if it makes any difference?

Offline

#4 2010-04-05 14:46:40

Bralkein
Member
Registered: 2004-10-26
Posts: 354

Re: Emacs & linum-mode

Hi, I am using the latest emacs from [extra] and it works as expected for me with both the GTK and console interfaces. Do you have anything else in your .emacs that might conflict with it somehow? Maybe you could post your .emacs so that we could try and reproduce the problem?

Offline

#5 2010-04-05 15:24:44

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

Re: Emacs & linum-mode

ok, i tried both bzr and otf versions from AUR, and I still get the same result...
I also tried it with blank .emacs conf file that only had (global-linum-mode 1) in it, and still didn't get line numbers on emacs start...

I also tried this on both of my machines, and both of them seem to ignore global-linum-mode in .emacs file

Last edited by pootzko (2010-04-05 15:31:53)


...I put on my robe and a wizard hat...

Offline

#6 2010-04-05 15:54:56

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

Re: Emacs & linum-mode

ummm, and now i figured something out...

it does not work when I run just emacs, but when I use emacs to open a file at the same time, then it works...
so, what now? big_smile


...I put on my robe and a wizard hat...

Offline

#7 2010-04-05 18:20:17

bt
Member
Registered: 2007-04-11
Posts: 198

Re: Emacs & linum-mode

In ~/.emacs I have the following:

;;LINUM
        (require 'linum)
        (global-set-key (kbd "<f6>") 'linum-mode)

Press f6 to toggle line numbers

Offline

#8 2010-04-05 22:11:13

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Emacs & linum-mode

pootzko wrote:

ummm, and now i figured something out...

it does not work when I run just emacs, but when I use emacs to open a file at the same time, then it works...
so, what now? big_smile

linum-mode seems to be disabled on the Emacs splash screen even when global-linum-mode is on.  Though, if line numbers don't display after using 'C-x C-f somefile', 'C-x C-b *scratch*', etc. from there, then you may be able to try something like (untested):

(add-hook 'find-file-hook '(lambda () (linum-mode 1)))

though it is not ideal.

Offline

#9 2010-04-05 23:05:54

pootzko
Member
From: Nerdvana
Registered: 2008-06-23
Posts: 109
Website

Re: Emacs & linum-mode

fixed it, and now it works as I wanted it to. it opens an 'empty' file and shows line numbers. for anyone who might need the solution, here is what I put into .emacs

; Set default font size                                                                                               
(set-face-attribute 'default nil :height 80)                                                                          
                                                                                                                      
; Open emacs maximized                                                                                                
(defun toggle-fullscreen ()                                                                                           
        (interactive)                                                                                                 
        (x-send-client-message nil 0 nil "_NET_WM_STATE" 32                                                           
                '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))                                                                
        (x-send-client-message nil 0 nil "_NET_WM_STATE" 32                                                           
                '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))                                                                
)                                                                                                                     
(toggle-fullscreen)                                                                                                   
(put 'downcase-region 'disabled nil)                                                                                  
                                                                                                                      
; Initialize line numbers                                                                                             
(global-linum-mode 1)                                                                                                 
                                                                                                                      
; Remove startupscreen and open an empty document                                                                     
(custom-set-variables '(inhibit-startup-screen t))                                                                    
                                                                                                                      
; Load zenburn color theme                                                                                            
(require 'zenburn)                                                                                                    
(zenburn)

...I put on my robe and a wizard hat...

Offline

Board footer

Powered by FluxBB