My current org file (e.g. work.org) has 20+ DONE tasks and Org-mode becomes extremely slow: even moving the cursor takes a 2-3 seconds sometimes. I decide I have to archive these DONE tasks, but I found I don't know what Org-mode is actually doing to my text when archiving.

There are a few common options to archive:

  1. archive subtree using the default command C-c C-x C-a It moves my subtree (a DONE task) from work.org to work.org_archive
  2. move subtree to archive file C-c C-x C-s It also moves my subtree from work.org_archive
  3. toggle ARCHIVE tag / to ARCHIVE sibling C-c C-x a/A It greys out my subtree (the DONE task) but the task remains visible on work.org when I expand the top tree. However, details of the subtree is not expandable, unless I do "force cycling of an ARCHIVEd tree" (C-TAB)

My questions are: If I archive using #3, does the content of completed tasks stay in work.org? And does #3 offer already significantly performance improvement over a large Org file?

Also, if I archive using #1 or #2, how can I: Search the archived contents on separate files? Do I just include the :archive: only? Or do I need to list and include all these files in my .emacs under org-agenda-text-search-extra-files?

And how do I refile a subtree by C-c C-w? Is it similar to refiling in other case: i.e. find the subtree in search by other ways, do a C-c C-w to move the subtree to the section I want, and then just save both the target org file and the .org_archive file in question. Is there other things I have to pay attention to?

My Emacs (25.1 64-bit in Windows10) just crashed... Emacs (esp. Org mode) has become so slow and almost inoperable that typing on Firefox is quicker.

  • I tried #3, and did a C-c a and then m to search for tags. None of the :ARCHIVE: entries showed up. Neither in s (search for keywords options) There must be something wrong. – menuhin Nov 24 '16 at 16:56
  • 3
    As a side comment: are you sure emacs is slow because of 20 DONE tasks? Have you tried to delete those and see if still is slow? (backup! backup!) I have a org file (agenda + random notes) with some 2.5k line, 500 bullets (tasks, subtasks, notes), a lot of org-tables, ... and it works "instantly", both on windows and linux. (version 24.3 on linux, similar or older on windows) – Rolazaro Azeveires Nov 24 '16 at 17:20
  • 3
    I should create a separate post on this slow Emacs issue. I have been trying to find the reason why my Emacs has become unusable: I have done a few times profiler-report and I still have to figure out what package these stalling sub-processes belong to. I have also used benchmark-init and tried to downsize my .emacs by removing unnecessary require and load statements and changing them into something else. – menuhin Nov 24 '16 at 18:40
  • 3
    If by chance you have minor-modes active, you may wish to disable them and see if performance gets better. For example, linum-mode causes slow-down in large buffers. – lawlist Nov 25 '16 at 5:39
  • 1
    @menuhin: I maintain at work a huge org file with +100 DONE tasks but the only slowdowns I experienced so far is when building column views. Emacs-25.1 Org 9.0.3 – Dieter.Wilhelm Jan 15 '17 at 13:16

It seems Org-mode's archiving function is not popular. Here's what I found:

By using toggle ARCHIVE tag / to ARCHIVE sibling C-c C-x a/A, the content of completed tasks stay in work.org. It seems to me it does not offer significantly performance improvement over a large Org file - if the chunk you have to archive is really large.

One can search archived contents on those separate files (in my case .org_archive files) by including them by the variable "org-agenda-text-search-extra-files" so that they are included in search using "C-c a s"

           (sa-find-org-file-recursively "~/Dropbox/Org/" ".org_archive") ;agenda-archives
           (sa-find-org-file-recursively "~/Dropbox/Org/journal/" ".txt") ;journals in .txt

The function "sa-find-org-file-recursively" that recursively look for files in a folder and its sub-folder can be found here: https://stackoverflow.com/questions/11384516/how-to-make-all-org-files-under-a-folder-added-in-agenda-list-automatically

One caveat is that only the "text search" searches only the Org header text of various levels, but nothing in its body text.

Including the :archive: tag may help when an entry is only tagged :archive: but not really archived. However, when an entry is archived it can only be reached during search when its file is included in the "org-agenda-text-search-extra-files" variable.

To refile an archived entry is quite simple, one can open the corresponding archive file (in Org format) and do a C-c C-w at the entry to be refiled.

  • The problem of slow Emacs is due to an outdated package for Org-mode that use UTF-8 characters (org-bullets) – menuhin Dec 15 '16 at 17:05
  • What does sa-find-org-file-recursively do that directory-files-recursively does not do? – mankoff Apr 14 '17 at 21:00
  • They may perform very similarly. Which package does the directory-files-recursively come from? – menuhin Apr 27 '17 at 17:38

Your Answer

