From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitrii Korobeinikov Subject: Re: Truncate lines option on file startup Date: Mon, 11 Nov 2019 14:40:25 +0600 Message-ID: References: <87k187gaof.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e91c5a05970e15b2" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34578) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iU5FX-0000wg-E4 for emacs-orgmode@gnu.org; Mon, 11 Nov 2019 03:40:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iU5FV-0002QN-N2 for emacs-orgmode@gnu.org; Mon, 11 Nov 2019 03:40:39 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:38358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iU5FV-0002Pm-G4 for emacs-orgmode@gnu.org; Mon, 11 Nov 2019 03:40:37 -0500 Received: by mail-wr1-x430.google.com with SMTP id i12so6699678wro.5 for ; Mon, 11 Nov 2019 00:40:37 -0800 (PST) In-Reply-To: <87k187gaof.fsf@ucl.ac.uk> 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" To: "Fraga, Eric" Cc: emacs-orgmode --000000000000e91c5a05970e15b2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > # -*- truncate-lines: t; -*- This works nicely, thank you! Never knew about these. By the way, I got the STARTUP to function. Turns out it's enough to set truncate-lines variable and the change is picked up automatically (docs say: "Calls these functions when changed: (#)"). Here is the code shall someone need it: (eval-after-load 'org (lambda () (setq org-startup-truncated nil) (push (list "truncate" 'truncate-lines t) org-startup-options) (push (list "notruncate" 'truncate-lines nil) org-startup-options))) Note that (setq org-startup-truncated nil) is needed for the notruncate option to work. Plus the stuff in the org-mode-hook runs after the STARTUP lines, so beware that it can also cause interference. Thanks all! =D0=B2=D1=81, 10 =D0=BD=D0=BE=D1=8F=D0=B1. 2019 =D0=B3. =D0=B2 18:47, Fraga= , Eric : > On Sunday, 10 Nov 2019 at 18:12, Dmitrii Korobeinikov wrote: > > PS if this turns out to be hairy, I can use .dir-locals.el, but the > feature > > would still be a nice-to-have. > > You could use file local variables for this, e.g. > > # Local Variables: > # truncate-lines: t > # End: > > at the end of your org file or > > # -*- truncate-lines: t; -*- > > as the first line of your file. > > This is not org specific so I guess there is no real justification for > an org variable for this feature. > > -- > Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78 > --000000000000e91c5a05970e15b2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> # -*- truncate-lines: t; -*-

T= his works nicely, thank you! Never knew about these.

By the way, I got the STARTUP to function. Turns out it's enough to = set truncate-lines variable and the change is picked up automatically (docs= say: "Calls these functions when changed: (#<subr set-buffer-redis= play>)"). Here is the code shall someone need it:

(ev= al-after-load 'org
=C2=A0 (lambda ()
=C2=A0 =C2=A0 (setq org-star= tup-truncated nil)
=C2=A0 =C2=A0 (push (list "truncate" 't= runcate-lines t) org-startup-options)
=C2=A0 =C2=A0 (push (list "no= truncate" 'truncate-lines nil) org-startup-options)))

Note that (setq org-startup-truncated nil) is needed for t= he notruncate option to work. Plus the stuff in the org-mode-hook runs afte= r the STARTUP lines, so beware that it can also cause interference.

Thanks all!

=D0=B2=D1=81, 10 =D0=BD=D0=BE=D1=8F=D0=B1. 20= 19 =D0=B3. =D0=B2 18:47, Fraga, Eric <e.fraga@ucl.ac.uk>:
On Sunday, 10 Nov 2019 at 18:12, Dmitrii K= orobeinikov wrote:
> PS if this turns out to be hairy, I can use .dir-locals.el, but the fe= ature
> would still be a nice-to-have.

You could use file local variables for this, e.g.

# Local Variables:
# truncate-lines: t
# End:

at the end of your org file or

# -*- truncate-lines: t; -*-

as the first line of your file.

This is not org specific so I guess there is no real justification for
an org variable for this feature.

--
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78
--000000000000e91c5a05970e15b2--