Windows 7, Emacs 25.1
I has myfile.org
It has many headlines in different state: TODO, POSTPONED, IN PROGRESS, DONE.
E.g.:
* Headline1
** IN PROGRESS Task#1_1
** DONE Task#1_2
** TODO Task1_3
* Headline2
** DONE Task#2_1
** POSTPONED Task#2_2
** TODO Task#2_3
I want to archive headlines only in DONE state.
The result in archive file (to.do.org_archive) must be somethink like this:
to.do.org_archive
* Headline1
** DONE Task#1_2
* Headline2
** DONE Task#2_1
Is this a possible? Thanks.
If the file is an agenda file, I would do an agenda match search for DONE items (C-a m TODO="DONE" RET), mark all the items from that file with "m", and then batch archive them (e.g. B A).
If the file is not an agenda file, then I would add it to the agenda list with C-c [ and then do the above. I would then take the file off the agenda list with C-c ]
Related
i want to have an idea of how much TODO are left in all my org-agenda files.
how can i get the number of TODO in a custom agenda view ?
i cannot believe there is no way to do that in orgmode
is there some code to display that info elsewhere, like in the bottom of a buffer ?
I have an agenda file, and use the default archive file. So agenda.org and archive to agenda.org_archive for example. When archived, the items get archival properties
* DONE some task
:PROPERTIES:
:ARCHIVE_TIME: 2021-07-27 Tue 15:18
:ARCHIVE_FILE: ~/agenda.org
:ARCHIVE_OLPATH: Misc
:ARCHIVE_CATEGORY: notes
:ARCHIVE_TODO: DONE
:END:
I'd like to search for these using org-tags-view, with ARCHIVE_TIME>"<+2w>" for example. This works in my main agenda file if I toggle org-agenda-archives-mode, but I cannot get it to search the agenda.org_archive file. I have added this file to org-agenda-text-search-extra-files, but that doesn't help. In fact this documentation says this "has no effect on other types of agenda commands, such as todo and tags/property searches".
So how can I search archives within an archive file?
Also, I have attempted by adding the archive file directly to org-agenda-files:
(setq org-agenda-files '("~/org"))
This directory contains both files, but this doesn't work either.
I'm trying to find a way to add a clickable link in org-mode that opens another local file and scrolls to a specific property id.
It's easier to explain with an example:
$ cat file1.org
* org links that I've tried and they don't work properly
[[file:path/to/another-file.org::#d89ba6bd-7c9a-4559-9965-7a6541f1a7c5][ref]]
[[file:path/to/another-file.org:id:d89ba6bd-7c9a-4559-9965-7a6541f1a7c5][ref]]
[[file:path/to/another-file.org::d89ba6bd-7c9a-4559-9965-7a6541f1a7c5][ref]]
[[file:path/to/another-file.org::id:d89ba6bd-7c9a-4559-9965-7a6541f1a7c5][ref]]
$ cat another-file.org
* Top category
** Category X
*** Question :drill:
:PROPERTIES:
:ID: d89ba6bd-7c9a-4559-9965-7a6541f1a7c5
:END:
Content of d89ba6bd-7c9a-4559-9965-7a6541f1a7c5 entry
*** Question :drill:
:PROPERTIES:
:ID: some-other-property-uuid
:END:
Content of some-other-property-uuid entry
Unfortunately, I can't change the structure of another-file.org. I can only reference using a property id.
Just renaming "Question :drill:" would have been much easier but it is duplicated many times and as I said it is not available for updates.
Update:
With "CUSTOM_ID" property it seems to be working
*** Question :drill:
:PROPERTIES:
:CUSTOM_ID: d89ba6bd-7c9a-4559-9965-7a6541f1a7c5
:END:
Content of d89ba6bd-7c9a-4559-9965-7a6541f1a7c5 entry
[[file:path/to/another-file.org::#d89ba6bd-7c9a-4559-9965-7a6541f1a7c5][ref]]
But is there any way to make it with with default :ID: property?
Try setting org-link-search-must-match-exact-headline to nil. That makes the third type of link above [[file:path/to/another-file.org::d89ba6bd-7c9a-4559-9965-7a6541f1a7c5][ref]] do a fuzzy text search, whereas the other values (t and the default query-to-create) are biased towards headlines when the target file is an Org mode file.
Here's the doc string of org-link-search-must-match-exact-headline:
org-link-search-must-match-exact-headline is a variable defined in ‘ol.el’.
Its value is nil
Original value was ‘query-to-create’
This variable is safe as a file local variable if its value
satisfies the predicate ‘symbolp’.
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 24.1 of Emacs.
Documentation:
Non-nil means internal fuzzy links can only match headlines.
When nil, the a fuzzy link may point to a target or a named
construct in the document. When set to the special value
‘query-to-create’, offer to create a new headline when none
matched.
Spaces and statistics cookies are ignored during heading searches.
BTW, I found it by reading the External Links section of the manual: look for text search and the accompanying footnote.
I have a subtree that I want to export as a latex document. That subtree needs a fairly long preamble specific to it, so I want to compile the preamble into a separate file, which I can then call with \input during export.
Right now, I can get the desired result with this sort of document
* Exporting with a file input for export-latex-header
:PROPERTIES:
:EXPORT_LATEX_HEADER: \input{stylefile}
:EXPORT_FILE_NAME: Main
:END:
content of the main file
** style file :noexport:
:PROPERTIES:
:EXPORT_FILE_NAME: stylefile
:END:
#+BEGIN_EXPORT latex
\usepackage{xyz}
\usepackage{abc}
#+END_EXPORT
I then perform two exports.
I export the subtree **style file with the body-only option
(selected from the export dispatcher), which gives me the file
stylefile.tex as output with the two lines of LaTeX.
I export the
subtree * Exporting... in the regular way, giving me Main.tex
with the correct preamble, and during compilation, the \input'ed
lines are compiled correctly.
Is it possible to automate the export process somehow, so that when I export the Main file, org-mode automatically exports the dependency, as well?
FWIW: I've tried defining a macro in org that expands to the desired pre-amble, but macro invocations in :EXPORT_LATEX_HEADER: are treated as verbatim, i.e., not expanded during export.
Org's narrow-to-subtree is wonderful, but sometimes I also want to see the chain of parent nodes, without all the uncle nodes.
For example, given this tree:
* a
** a.a <- extraneous great uncle
** a.b
*** a.b.a <- extraneous uncle
*** a.b.b <- want to see context for this
**** a.b.b.a
**** a.b.b.b
I want to narrow my view to see this:
* a
** a.b
*** a.b.b <- want to see context for this
**** a.b.b.a
**** a.b.b.b
How can I make this happen?
AFAIK, there is no such narrowing facility - but the function org-display-outline-path will display "a/a.b" for the heading in question, i.e. the outline path of headings above your current heading. You can add the function to the modeline indicator if you want it to be permanently visible - or perhaps use the (normally absent) header line which has more space to grow. Try with this file:
* foo
#+BEGIN_SRC emacs-lisp
(setq header-line-format '(:eval (org-display-outline-path)))
#+END_SRC
#+RESULTS:
: (:eval (org-display-outline-path))
** bar
*** baz
Evaluate the code block to set the header-line-format-variable and then see what the header line says when the cursor is on the "** bar" header or the "*** baz" header.