Meuporg: Emacs Integration
This file is part of the documentation of meuporg.
Table of Contents
1 Emacs minor-mode
If you are wise enough to have made the decision to use emacs, then your decision is even wiser now! If you did add the meuporg.el to your loaded files then emacs will automatically turn on the meuporg minor-mode (which is signaled by "!M!" in the mode-line) when a file is in a directory with a meup.org file in one of its parents. This mode provides elisp functions used to interact with meuporg and items, shortcuts to easily access these and fontifying of standard items.
2 Elisp Functions
2.1 Keyboard Shortcuts
The default prefix for all meuporg-mode commands is "C-!".
Shortcut | Description | elisp function |
---|---|---|
C-! u | Save, and Update the main file (even when called from another file). | meuporg/update |
C-! o | Open the main File. | meuporg/open-main |
C-! n | Go to the Next item in the file. | meuporg/go-to-next-item |
C-! p | Go to the Previous item. | meuporg/go-to-previous-item |
C-! l | Highligths the items in the current-file and Lists them in another window (see Item List) | meuporg/show-items |
C-! i t | Insert a "TODO" item. | meuporg/insert-todo |
C-! i c | Insert a "CONTINUE" item. | meuporg/insert-continue |
C-! i i | Insert a "IMPROVE" item. | meuporg/insert-improve |
C-! i k | Insert a "CHECK" item. | meuporg/insert-check |
C-! i f | Insert a "FIXME" item. | meuporg/insert-fixme |
C-! i r | Insert a "FIXREF" item. | meuporg/insert-fixref |
C-! i s 1 | Insert a "SECTION" item. | meuporg/insert-section |
C-! i s 2 | Insert a "SUBSECTION" item. | meuporg/insert-subsection |
C-! i s 3 | Insert a "SUBSUBSECTION" item. | meuporg/insert-subsubsection |
2.2 Item List
The function meuporg/show-items creates a new buffer containing all the items in the current file. These are listed in the order in which they appear, each on one line and a color code displays known items in some colour. It also uses specific items called structural items to make sense of the file.
2.2.1 Structural items
As a good programmer, you give your code a structure. I personnaly go further and give a tree like structure using a system inspired by LaTeX section, subsections, etc. For instance, the file itemDb.py of meuporg contains the code used to select only the items corresponding to a given criteria. It it structured like this:
SECTION Boolean management SUBSECTION Attribute class SUBSECTION Not class SUBSECTION AlwaysTrue class SUBSECTION AlwaysFalse class SUBSECTION And class SUBSECTION Or class SUBSECTION Criteria class SECTION A poor man's database for the items SUBSECTION Sorting methods SUBSECTION Obtaining items from the db SECTION Tests
Note that meuporg is very clever and uses LaTeX's "\section{}" as structural items. Thus, using meuporg/show-items in a TeX file will display something like this.
A structural item is just a regular item, except that it must have one of these names.
name | depth |
---|---|
SECTION | 1 |
SUBSECTION | 2 |
SUBSUBSECTION | 3 |
LEV1 | 1 |
LEV2 | 2 |
LEV3 | 3 |
LEV4 | 4 |
… | … |
LEVN | N |
2.2.2 Use of the item list
The list of items uses its own shortcuts: when the cursor is on it, you can use any of these keys.
key | description |
---|---|
q | Kills the buffer containing the item list and closes its window |
RET | Opens the file containing the item at the line of the item under the cursor and kills the item list |
<right> | Opens the file containing the item at the line of the item under the cursor and leaves the cursor in the item list |
p | Moves cursor to the previous SECTION |
n | Moves cursor to the next SECTION |
3 Syntax highlighting
As soon as a word is enclosed between exclamation marks, its font is changed.