emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Truncate lines option on file startup


From: Dmitrii Korobeinikov
Subject: Re: Truncate lines option on file startup
Date: Mon, 11 Nov 2019 14:40:25 +0600

> # -*- 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: (#<subr set-buffer-redisplay>)"). 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!

вс, 10 нояб. 2019 г. в 18:47, Fraga, Eric <address@hidden>:
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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]