emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Tips on maintaining history in Org Mode


From: Ihor Radchenko
Subject: Re: Tips on maintaining history in Org Mode
Date: Mon, 01 Mar 2021 11:42:38 +0800

Samuel Wales <samologist@gmail.com> writes:

> Hi Ihor,
>
> it never occurred to me that bulk archiving could be sped up by
> changing anything about the archive files.  i assumed that archiving
> worked by appending to those files, so once the initial find-file was
> performed, there should be no additional slowness.

Disregarding the initial find-file (which may also be very slow on large
archives), the slowness is happening because many org-mode commands are
using line-motion functions that respect visibility. Those commands
become slow when there are many folded elements (see [1] for technical
details why). So, many org commands tend to lag on large archives.

The lags can be solved in several ways:
1. Reduce the archive file size
2. Use optimised folding mechanism [1] (this will speed up org-mode in
general as well)
3. (untested) Put #+STARTUP: showeverything at the beginning of the
   archives, so that nothing is going to be folded

> i will keep in mind disabling font lock in archive files.  any
> suggested code for that?

Note that it will mostly affect find-file performance. To disable
font-lock, you will need to customise font-lock-global-modes, so that it
does not auto-start in org-mode. The value should be something like
'(not org-mode), but check the current value - you may have other
customisation in place.

Then, you will need to have a custom org-mode-hook that activates
font-lock only when the org file is not the archive file. Something like

(defun yant/font-lock-activate-maybe ()
"Activate font-lock in non-archive org buffers."
(when (org-all-archive-files) (font-lock-mode +1)))
(add-hook 'org-mode-hook #'yant/font-lock-activate-maybe)

> your config is impressively [and for me
> dauntingly] comprehensive.  the Archiving anchor does not seem to have
> a referent.  I searched for archiving, but didn't seem to find what
> you were probably pointing me to.

Sorry, the config is actually not yet formatted for public use. You can
search for the code block containing "defun org-archive--compute-location". 
You will need that code block and the following code block.

[1] https://github.com/yantar92/org

Best,
Ihor




reply via email to

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