[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How can I autorun M-x linum-mode when file is opened?
From: |
Samuel W Flint |
Subject: |
Re: [O] How can I autorun M-x linum-mode when file is opened? |
Date: |
Sun, 10 Aug 2014 13:07:36 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
On 10 Aug 2014, Sharon Kimble wrote:
[Edited for the sake of brevity]
>>> How can I have a command auto-run when a file is opened from
>>> 'desktop recovery' please? I want to auto-run "M-x linum-mode" when
>>> I open my daily journal, which stays open all the time. Running that
>>> command will switch off linum-mode for that file, which may stop
>>> "file-rot" that I have observed in the past. This can, at present,
>>> only be resolved by shutting down emacs for half an hour or so, and
>>> then restarting it, and normal functionality will have been
>>> restored.
Have you considered using a hook? That is what they are for, and
generally, I’ve found that linum mode in an org file can be annoying, so
in my init file I have =(add-hook ‘org-mode-hook #’(lambda ()
(linum-mode -1)))=, and, while I have Linum on globally, this disables
it for all org mode files.
Sam
--
Samuel W. Flint
address@hidden (402) 517-8468 <XMPP>
sip: address@hidden
----------------------------------------------------------------
http://flintfam.org/~swflint
http://samflint.com
4096R/266596F4
(9477 D23E 389E 40C5 2F10 DE19 68E5 318E 2665 96F4)
----------------------------------------------------------------
Why is this email likely less than five sentences?
http://five.sentenc.es
pgpbeDI1c7Ej3.pgp
Description: PGP signature