Org mode project at FSF40 hackathon
This document describes the task the Org-mode maintainers prepared for FSF40 hackathon. See https://www.fsf.org/events/fsf40-hackathon for terms and conditions, prizes, and rules in general.
Apart from the project prepared by me for the hackathon, some participants decided to go with others. See the etherpad for more details: https://pad.emacsconf.org/orgmeetup
For async coordination, you can use Org mailing list. See https://orgmode.org/worg/org-mailing-list.html
Shared etherpad notes: https://pad.emacsconf.org/orgmeetup (I am re-using the pad for orgmeetup for this hackathon).
As of now, people are actively brainstorming the task at the Jitsi server. Note that you will not see the full chat history when you join. Ask around to get the message log.
Note that FSF has server issues right now, which affects git repository access. You can find Org code mirror at https://git.sr.ht/~bzg/org-mode
There is FSF’s galenne server where we can screen
share and talk by voice. The server is at
https://galene.fsf.org/group/hackathon-org-mode/.
Username: <any>; Password:
Let’s use jitsi. It is less confusing.
https://meet.jit.si/OrgFSF40hackathon
JexpAgH9kf.
Also, remember that you can ask questions and coordinate at #org-mode and/or #fsf-hackathon IRC.
Project: New un-archiving functionality for Org mode
This project is about extending functionality of Org mode - a major mode for GNU Emacs and a plain text markup. Org mode can be seen as a combination of Obsidian (or Notion), Jupyter notebooks, LaTeX, classic outliner, task manager, calendar, spreadsheet, and time tracker. See https://orgmode.org/features.html
Org mode is written in Elisp and integrates into common GNU Emacs functionalities. Elisp is extensively documented in https://www.gnu.org/software/emacs/manual/html_node/elisp/, including coding conventions and best practices: https://www.gnu.org/software/emacs/manual/html_node/elisp/Tips.html In addition, all the necessary information about contributing to Org mode is detailed in https://orgmode.org/worg/org-contribute.html.
For the purposes of this project, you need to understand Org outline markup described in https://orgmode.org/manual/Headlines.html, and how metadata is stored under the heading: https://orgmode.org/manual/Property-Syntax.html.
Your task is to extend the archiving feature of Org mode - moving
outlines that are no longer needed:
https://orgmode.org/manual/Archiving.html.
This feature is very simple - Org mode moves certain headings and their
contents into another file (archive file) or under dedicated heading
(usually at the end of the document). By default, Org mode also keeps
information about the original heading location (see
org-archive-save-context-info user option). In Org, a heading is just
text, so ‘archive’ means cut here and paste there.
Some users may archive headings by mistake or change their mind after archiving, needing to revert the operation and move the archived headings back to their original location. This can happen either immediately after archiving, or some time (maybe even years) after. Such functionality is currently missing, and it is what I want you to implement during the hackathon.
On the code side, the functions responsible for archiving are
org-archive-subtree and org-archive-to-archive-sibling. Please
refer to their source code to get an idea about Elisp functions you will
need to complete the project. Remember that Emacs has extensive
documentation system. You can use C-h f to read a function’s
documentation and jump to their definitions. Most of Org mode functions
are documented.
The main function you will likely need to work with is
org-archive-subtree - this is the function you need to “reverse” to
implement un-archiving.
Below, I will provide a tentative task list that will guide you through the project:
[ ]Get familiar with the ideas behind archiving system by reading the manual at https://orgmode.org/manual/Archiving.html.[ ]Get familiar with Org mode archiving:
Create a small test.org file with a few headings and subheadings
* Heading 1 * Heading 2 :tag: ** Subheading 1 :tag2: Some text. ** Subheading 2
- Try archiving different headings using C-c C-x a (or M-x org-archive-subtree)
- Observe where archived items go (same file, different file, or archive-sibling)
- Experiment with different settings:
- Set
org-archive-save-context-infoto different values and see what information is preserved - Try
org-archive-default-commandto see alternative archiving behaviors - Try different
org-archive-location
- Set
Start with simple cases before moving to more complex scenarios.
[ ]Consult
$REPO/lisp/org-archive.elto understand how the archiving works on the code side. Pay attention to user options that can tweak the archiving behavior, especiallyorg-archive-save-context-info. Remember that user options might be modified, which should be taken into account in your code design. You can clone Org mode source code:git clone https://git.sv.gnu.org/git/emacs/org-mode.git
[ ]Implement un-archiving procedure as a new interactive function. You can re-use a lot of code fromorg-archive-subtreethere, adding logic for searching the original location. Start by making un-archiving work for the straightforward case (location unchanged). Corner cases—file moved, heading deleted, or new siblings inserted—can be handled later.[ ]Once done, implement tests for the new command, checking yourself and ensuring maintainability of your code. Org mode testing system is described in $REPO/testing/README file, and often boils down to simplemake testin the git repo. The tests relevant to archiving are all in$REPO/testing/lisp/test-org-archive.el.[ ]Consider possible user options where un-archiving may be customized. For example, iforg-archive-subtree-add-inherited-tagswas non-nil when the heading was archived, the archived copy will contain extra tags. Users might want to keep or drop them. The strategy how to handle those tags might (or might not) be something users what to customize.[ ]If you do come up with such options, make sure to document them in the manual. In any case, do document the new command. The manual is written using Org markup in doc/org-manual.org. Please pay attention to doc/Documentation_Standards.org and otherwise follow by example.[ ]If you add new options, write relevant tests.[ ](optional) Think about un-archiving afterorg-archive-to-archive-sibling(this function does not save the original context by default). Consider modifying it.[ ]At the very end, prepare your changes in the form of a patch set, as expected for all contributions. See https://orgmode.org/worg/org-contribute.html#patches