From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sharon Kimble Subject: Re: How can I autorun M-x linum-mode when file is opened? Date: Mon, 11 Aug 2014 10:40:59 +0100 Message-ID: <87bnrre53o.fsf@skimble.plus.com> References: <87iom0i983.fsf@skimble.plus.com> <87tx5kfcvx.fsf@skimble.plus.com> <87y4uwcj6f.fsf@turing.flintfam.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGm6N-000693-Qp for emacs-orgmode@gnu.org; Mon, 11 Aug 2014 05:41:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGm6J-0005pc-4n for emacs-orgmode@gnu.org; Mon, 11 Aug 2014 05:41:15 -0400 Received: from avasout06.plus.net ([212.159.14.18]:46595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGm6I-0005pE-VR for emacs-orgmode@gnu.org; Mon, 11 Aug 2014 05:41:11 -0400 In-Reply-To: <87y4uwcj6f.fsf@turing.flintfam.org> (Samuel W. Flint's message of "Sun, 10 Aug 2014 13:07:36 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Samuel W Flint Cc: org-mode --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Samuel W Flint writes: > 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=E2=80=99ve found that linum mode in an org file can be annoy= ing, so > in my init file I have =3D(add-hook =E2=80=98org-mode-hook #=E2=80=99(lam= bda () > (linum-mode -1)))=3D, and, while I have Linum on globally, this disables > it for all org mode files. > Thanks for this Sam, it is now working beautifully. Sharon. =2D-=20 A taste of linux =3D http://www.sharons.org.uk my git repo =3D https://bitbucket.org/boudiccas/dots TGmeds =3D http://www.tgmeds.org.uk Debian testing, fluxbox 1.3.5, emacs 24.3.92.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJT6I+rAAoJEDaBgBkK+INbn84P/jjlFPSSAjouGszyKpc9kSUM 9NRkH9s6E6PELiTGcrvc7FOyH5TvsX7h6gBflsaYDAVMfZI1eXl3ftO425V+iTQK 1rbat+ZSj/27PI6J7VJa4NJWmk64UnWrsRLBJlaxCwbdgaAYET718IzfaXdKmi0w 5Qp1iOWdXrnV761td1tchHrjDKIBNeWTXVd7NU5UWu1TgD0FL941NLmlFqG7Ag7/ KIYYyS9Gz0VpjBhDAUzHQ4uZLVrIHwOZWYfQZj6FlTNSWq0H6FjO36ZjhRq96jnE fkmBZXhgynpNTNMHJ+pml1h0EZlgCzJ5C/R1aHfCZhoA0KGPl9m/UUmeFpbbvJow 8tW//cd93iEg8h6lXViZG3RD9v/le6UosV1G+tnO8F2WgyPcv5pt4OqxsciLGClp QXSmMEL5VOPCBj4j7TtR35I3baD1ACGDbRCM9QP23021ZrCY+cKVg/i8JKkSr4bi 4fcFQ+lnVRn62BBLHMdp1RGxi6hXmstkU+PQG4k8wwapt7HvRqPV8Kf2+vFn29bF 2txr9vy9nekwQQ9JhSBg5Q/cJ7W1za+2whCV34/gF/BWNR+Xp2sPBgRTgEQm1tJE lAQYswzoG2daTybnflDIXE96ukTuLWwMmHCBA9PUwWD+xLuKj4HeKaXZvDjeyvnW jlegEpizViR0Usj1Hr5R =m6a7 -----END PGP SIGNATURE----- --=-=-=--