all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Samuel Wales <samologist@gmail.com>
Cc: emacs-orgmode@gnu.org, David Masterson <dsmasterson92630@outlook.com>
Subject: Re: Tips on maintaining history in Org Mode
Date: Mon, 01 Mar 2021 11:42:38 +0800	[thread overview]
Message-ID: <87pn0j8rpt.fsf@localhost> (raw)
In-Reply-To: <CAJcAo8u8LwRyKKwmjWoo5WqOR9AQdpnErGaosMeugzKsH7Bj1g@mail.gmail.com>

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	other threads:[~2021-03-01  3:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26  6:22 Tips on maintaining history in Org Mode David Masterson
2021-02-26  7:25 ` Ihor Radchenko
2021-02-26 22:51   ` David Masterson
2021-02-27  6:28     ` Ihor Radchenko
2021-03-01  5:45       ` David Masterson
2021-02-26  7:54 ` Tim Cross
2021-02-26 22:55   ` David Masterson
2021-02-26 22:59     ` Tim Cross
2021-02-27  3:17       ` David Masterson
2021-02-27  4:21         ` Samuel Wales
2021-02-27  6:38           ` Ihor Radchenko
2021-02-26  9:37 ` Eric S Fraga
2021-02-26 23:00   ` David Masterson
2021-02-26 19:24 ` TRS-80
2021-02-26 21:34 ` Samuel Wales
2021-02-27  6:42   ` Ihor Radchenko
2021-02-28 22:13     ` Samuel Wales
2021-03-01  3:42       ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn0j8rpt.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=dsmasterson92630@outlook.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=samologist@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.