org-faq.org 69 KB

Welcome

:PROPERTIES: :CUSTOM_ID: Welcome :END:

Welcome to the Org-mode FAQ.

You can navigate the FAQ by clicking on any of the topics in the Table of Contents.

If your browser supports JavaScript, you can...

  • move through the topics by typing "=n=" (next) and "=p=" (previous).
  • see an outline view of the FAQ by typing "=m=" or clicking "=toggle
  • view=" (above).
  • search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
  • see a full list of navigation commands by typing "=?=" or clicking
  • "=Help=" (above).

What is org-mode?

Can I implement a GTD workflow with Org-mode?

:PROPERTIES: :CUSTOM_ID: What-is-org-mode :END: :PROPERTIES: :CUSTOM_ID: GTD-workflow-with-Org-mode :END:

Yes, you can. Check for discussions and pointers here.

What is the difference between Org and TaskPaper?

:PROPERTIES: :CUSTOM_ID: Org-and-TaskPaper :END:

There is really no difference. Org is as simple as TaskPaper. It is just that, when using Org within Emacs, it lets you do many things that you wouldn't be able to do with TaskPaper. Yes, TaskPaper is fiddle-proof and people using Emacs tends to like fiddling (which is orthogonal to the idea of using todo-list efficiently), but this is just a matter of discipline and common sense, not one of Org's design.

What is the meaning of the Unicorn on Org's website?

Read Carsten's enlightening statement on this. :PROPERTIES: :CUSTOM_ID: unicorn :END:

The Unicorn is the logo of Org-mode because:

  • Org-mode is the UNICs of ORgaNizers.
  • Org-mode is an Emacs mode, so it makes sense to use an animal
  • similar or related to the gnu used for GNU Emacs.
  • Org-mode is meant to show you the way, and an animal with two horns
  • can not do this very well, can it?
  • Unicorn tears are said to reverse petrification, and wasn't this how
  • we all felt before getting to some degree of time and task management?
  • It will take forever to learn everything there is to know about a
  • unicorn.
  • A unicorn is a fabulous creature. Org-mode wants to be a fabulous
  • creation.

Using a unicorn was originally Bastien Guerry's idea, his friend /Christophe Bataillon/ designed the logo for us, and /Greg Newman/ gave it a refresh some time later. Bastien writes why he chose a unicorn:

The first reason is not linked to the animal, but to the sounding of the

word "Unicorn" - because Org gives you a /uni/que way of producing files

in several format (HTML, LaTeX, etc.)

The second reason is that a Unicorn doesn't really exist, it is just

something you can dream about, and make others believe it does exist.

Just like the perfect organizer.

There was a thread about unicorns on the mailing list. Christopher Suckling posted a link showing how to make a simple foldable unicorn (very appropriate for an outlining program!).

Tim Burt made a very complicated one which is now a treasured possession of the Org-mode author.

  • Tim Burt made a folded Unicorn to match the spirit of Org - see the
  • whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
  • Are unicorns real? Answer here by Ross Laird.

Keeping current

How do I keep current with Org mode development?

:PROPERTIES: :CUSTOM_ID: Keeping-current :END: :PROPERTIES: :CUSTOM_ID: keeping-current-with-Org-mode-development :END:

Org mode is developed in Git. You can keep up-to-date with Org mode developement by cloning Org mode repository and refreshing your copy with latest changes whenever you wish. You only need to use two Git commands (clone and pull.) Here are the steps in brief (please customize locations to suit your setup):

  1. Select a location to house the Org mode repository (approx. 40
  2. MB; includes documentation, compiled elisp files and history going all the way back to v4.12a)

$ mkdir $HOME/elisp && cd $HOME/elisp

  1. Clone the Org mode Git repository.

Recommended approach:

$ git clone git://repo.or.cz/org-mode.git

Alternate approach if you are behind a firewall that allows only HTTP (can be quite slow):

$ git clone http://repo.or.cz/r/org-mode.git
  1. Compile and install Org mode and build documentation.
$ cd org-mode && make && make doc && make install

Please note that you can choose to not compile at all and run using source =.el= files only. Compiled files speed things up.

  1. This is where you configure Org mode with Emacs. Please refer
  2. to [[./org-tutorials/index.org][Org tutorials]].
  1. Keeping up-to-date.

Cloning the repository is a one time activity. From this point onwards you only need to pull the latest changes.

$ cd $HOME/elisp/org-mode

and then

$ git pull && make clean && make && make doc && make install
  1. You should restart org mode to have the changes take effect (if
  2. you are not rebooting Emacs.) Also since the intention is to "keep up" with Org mode, you should visit ChangeLog and updated sections of documentation for latest updates (use =git log=.)
  1. As you use your repository over time it will accumulate loose objects.
  2. You can reduce the total size of your git repository with

$ git gc

which will consolidate loose git objects into pack files. This reduces the size of the repository and speeds up data access to the objects.

How can I keep local changes and still track Org mode development?

:PROPERTIES: :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development :END:

Say you want to make minor changes to the Makefile to reflect your location for emacs.

Create a local branch for your changes on top of origin/master as follows:

$ git checkout -b local origin/master
$ git config branch.local.rebase true
# Make your changes to the Makefile and create a new commit
$ git add Makefile
$ git commit -m 'My local Makefile configurations'
# Update git to a newer version
$ git pull

Now each time you pull new commits from the distribution repository your local commits will be rewound and replayed on top of the new origin/master.

-----------

You would normally work on your local branch which includes your custom commits; there's no need to switch back to the =master= branch.

-----------

Here is an example of dealing with conflict resolution during git pull.

If you get a conflict during a git pull you will need to edit the file with the conflict to fix up the conflicting lines and then tell git that you have resolved the conflict.

Conflict resolution goes something like this:

  1. git pull fails with a conflict
  2. edit the file
  3. git add the file to mark the conflict resolved
  4. git rebase --continue
  5. lather, rinse, and repeat 2-4 as needed

For this example we have the following Makefile:

#
# Example Makefile
#

EMACS=emacs

VERSION=V1.0

and we need to change the EMACS=emacs line to EMACS=myemacs to make it work well on our system.

To do this we

  • create a local branch for our work
$ git checkout -b local origin/master
$ git config branch.local.rebase true

This marks the branch so that all local commits on it are rebased on top of any new commits we get in origin/master during a git pull operation.

  • Make our custom changes

Edit the makefile so it looks like this:

#
# Example Makefile
#

EMACS=myemacs

VERSION=V1.0
  • Create a commit with our custom changes
  • $ git add Makefile
    $ git commit -m 'My local Makefile configurations'
    
  • Later we do a git pull but that fails with conflicts.
$ git pull remote: Counting objects: 5, done. ... Patch failed at 0001. When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort".
  • Fix the conflict in your favourite editor

Conflict markers look like this:

<<<<<<< HEAD:Makefile
EMACS=emacs22
=======
EMACS=myemacs
>>>>>>> Change emacs location:Makefile

This attempted git pull caused a conflict. Fire up your favourite editor and fix the conflict in the Makefile. The conflict markers are <<<<<<<<<< , ===== , and >>>>>>>>>>. Fix the Makefile appropriately and delete the conflict markers. You already edited these lines earlier so fixing it should be trivial.

In this case we changed EMACS=emacs to EMACS=myemacs and upstream changed EMACS=emacs to EMACS=emacs22. Just fix the file and save it by deleting the conflict markers and keeping the code you need (in this case the EMACS=myemacs line which we originally modified.)

  • Mark the file's conflict resolved
$ git add Makefile

You use git add because you are adding new content to be tracked - you're not adding a file, but you are adding changes in content.

  • Continue the rebase operation
$ git rebase --continue

If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.

At anytime during the rebase conflict resolution you can say "oops this is all wrong - put it back the way it was before I did a pull" using

$ git rebase --abort

How can I install an up-to-date version of org-mode without "make" tools?

:PROPERTIES: :CUSTOM_ID: installing-org-without-make-tools :END:

If you are using org-mode on a computer that lacks developer tools for compiling software, such as GNU Make, you will have to use a *different* installation method than the one outlined in the manual.

Please see this thread on the mailing list for several different ways you can install a recent version of org-mode without using the customary make clean && make && make install.

The result of that discussion is the file/function found in http://orgmode.org/worg/org-hacks.php#compiling-org-without-make.

Setup

:PROPERTIES: :CUSTOM_ID: Setup :END:

How can I quickly browse all Org options?

M-x org-customize RET

See also Carsten's Org customize tutorial and this customization guide for details.

Can I use the editing features of org-mode in other modes?

:PROPERTIES: :CUSTOM_ID: use-editing-features-in-other-modes :END:

Not really---but there are a few editing features you can use in other modes.

  • For tables there is orgtbl-mode which implements the table
  • editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
  • For ordered lists there is orgstuct-mode which allows for easy
  • list editing as a minor mode. (To enable, type =M-x orgstruct-mode=)

You can activate these modes automatically by using hooks:

(add-hook 'mail-mode-hook 'turn-on-orgtbl)
(add-hook 'mail-mode-hook 'turn-on-orgstruct)

For footnotes, there is the function org-footnote-action, which works in non-org buffers. This function is a powerful tool for creating and sorting footnotes. To use it globally, you can add the following keybinding to your =.emacs= file (requires Org 6.17 or greater):

(global-set-key (kbd "C-c f") 'org-footnote-action)

For other features you need to switch to Org-mode temporarily, or prepare text in a different buffer.

Why isn't feature "X" working the way it is described in the manual?

:PROPERTIES: :CUSTOM_ID: making-sure-org-mode-is-up-to-date :END:

Org-mode develops very quickly. There have been a great many changes, for instance, since the release of Emacs 22, which shipped with version 4.67d of org-mode. (Emacs 23 is expected to ship with version 6.21b.)

Many of the users on the org-mode mailing list are using either a recent release of org-mode or the development version of org-mode from the git repository.

If some settings and features aren't working the way you expect, make sure that the version of the manual you are consulting matches the version of org-mode you are using.

  • You can check which version of org-mode you are using by
  • selection =Org --> Documentation --> Show Version= in the Emacs menu.
  • The manual at www.gnu.org corresponds to the version of org-mode
  • released with the latest official Gnu Emacs release (Emacs 22 and org-mode 4.67d as of February 2009). Note: compared with the manual at the orgmode.org, the manual at www.gnu.org is considerably out of date.

For instructions on how to stay current with org-mode, consult this FAQ or follow the instructions on the official org-mode site.

Can I get the visibility-cycling features in outline-mode and outline-minor-mode?

:PROPERTIES: :CUSTOM_ID: use-visibility-cycling-in-outline-mode :END:

Yes, these functions are written in a way that they are independent of the outline setup. The following setup provides standard Org-mode functionality in outline-mode on TAB and S-TAB. For outline-minor-mode, we use C-TAB instead of TAB, because TAB usually has mode-specific tasks.


(add-hook 'outline-minor-mode-hook
  (lambda ()
    (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
    (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
(add-hook 'outline-mode-hook
  (lambda ()
    (define-key outline-mode-map [(tab)] 'org-cycle)
    (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))

Or check out outline-magic.el, which does this and also provides promotion and demotion functionality. outline-magic.el is available at Outline Magic.

Can I save/restore the visibility state of an org-mode buffer?

Well, no.

How can I keep track of changes in my Org files?

:PROPERTIES: :CUSTOM_ID: track-of-changes-in-Org-files :END:

Use git to track the history of the files, use a cronjob to check in changes regularly. Such a setup is described by Bernt Hansen in this message on emacs-orgmode.

Can I use Org-mode as the default mode for all README files?

:PROPERTIES: :CUSTOM_ID: Org-mode-as-default-mode :END:

Add the following to your .emacs file:

(add-to-list 'auto-mode-alist '("README$" . org-mode))

You can even make it the default mode for any files with unspecified mode using

(setq default-major-mode 'org-mode)

Can I use ido.el for completing stuff in Org?

:PROPERTIES: :CUSTOM_ID: ido-complete :END:

Yes, you can. If you are an ido user and ido-mode is active, the following setting will make Org use ido-completing-read for most of its completing prompts.

(setq org-completion-use-ido t)

Should I use one big org file or multiple files?

:PROPERTIES: :CUSTOM_ID: how-to-organize-org-mode-files :END:

Org-mode is flexible enough to accomodate a variety of organizational and time management schemes. Org's outline cycling and convenient editing and navigation commands make it possible to maintain all of your projects and notes in a single file. But org-mode's quick and easy hyperlinks, along with easy refiling of notes and todos, also make it a delight to maintain a private "wiki" consisting of multiple files.

No matter how you organize your org files, org-mode's agenda commands make it easy to search all your notes and gather together crucial data in a single view.

Moreover, several org-mode settings can be configured either globally in your =.emacs= file or locally (per file or per outline tree). See the manual for more details. For an example of local customizations see this FAQ.

Here are a few ideas for organizing org-mode files:

  • A single file for all your projects and notes.
  • One file per project.
  • One file per client.
  • One file per area of responsibility or type of work (e.g.,
  • household, health, work, etc.).
  • One file for projects, one for appointments, one for reference
  • material, one for someday/maybe items, etc.
  • A wiki of hyperlinked files that grows and adapts to meet your
  • needs.

For more ideas, see some of the links on the org-tutorial index or this page on org-mode and GTD.

Why doesn't C-c a call the agenda? Why don't some org keybindings work?

:PROPERTIES: :CUSTOM_ID: setting-global-keybindings :END:

Org-mode has a few global keybindings that the user must set explicitly in an =.emacs= file. These keybindings include the customary shortcut for calling the agenda (C-c a). If nothing happens when you type C-c a, then make sure that the following lines are in your =.emacs= file:


;; The following lines are always needed.  Choose your own keys.
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

You may, of course, choose whatever keybindings work best for you and do not conflict with other modes.

Please see this section of the manual if you have additional questions.

Why aren't some of the variables I've customized having an effect?

:PROPERTIES: :CUSTOM_ID: load-org-after-setting-variables :END:

Some org variables have to be set before org.el is loaded or else they will not work. (An example is the new variable =org-enforce-todo-dependencies=.)

To make sure all your variables work you should not use (require 'org). Instead use the following setting:

(require 'org-install)

You should also make sure that you do not require any other org-...= files in your .emacs= file before you have set your org variables, since these will also cause org.el to be loaded. To be safe, load org files after you have set your variables.

Org-mode has a lot of colors? How can I change them?

:PROPERTIES: :CUSTOM_ID: customizing-org-faces :END:

This is a question that applies to Emacs as a whole, but it comes up quite frequently on the org-mode mailing list, so it is appropriate to discuss it here.

If you would like to change the style of a face in org-mode (or any other Emacs mode), simply type M-x customize-face [RET] while the cursor is on the color/style you are interested in modifying. You will be given the opportunity to customize all the faces located at that point.

If you would like an overview of all the faces in org-mode, you can type C-u M-x list-faces-display [RET] org and you will be shown all the faces defined by org-mode along with an illustration of their current settings.

Finally, if you would like verbose information about the properties of the text under the cursor, you can type C-u C-x =.

How can I make sure that timestamps appear in English?

:PROPERTIES: :CUSTOM_ID: timestamps-and-system-time-locale :END:

If your system's locale is not set to English, but you would like the timestamps in your org-mode files to appear in English, you can set the following variable:

(setq system-time-locale "C")

Errors and general problems

When I try to use Org-mode, I always get the error message (wrong-type-argument keymapp nil)

:PROPERTIES: :CUSTOM_ID: Errors :END: :PROPERTIES: :CUSTOM_ID: wrong-type-argument-keymapp :END:

This is a conflict with an outdated version of the allout.el, see the Conflicts section in the manual

Org-mode takes over the TAB key. I also want to use YASnippet, is there a way to fix this conflict?

:PROPERTIES: :CUSTOM_ID: YASnippet :END:

    [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs. It is inspired by TextMate's templating syntax.
  • watch the video on YouTube
  • see the intro and tutorial

*Note*: yasnippet is not compatible with org-indent-mode currently there is no known way to use both successfully with yas/trigger-key= set to =TAB (or [tab] etc...)

The way Org-mode binds the TAB key (binding to [tab] instead of =\t=) overrules yasnippets' access to this key. The following code fixes this problem:

(add-hook 'org-mode-hook (lambda () (org-set-local 'yas/trigger-key [tab]) (define-key yas/keymap [tab] 'yas/next-field-group)))

If the above code doesn't work (which it may not with later versions of yasnippet). Then try the following

(defun yas/org-very-safe-expand () (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))

(add-hook 'org-mode-hook (lambda () ;; yasnippet (using the new org-cycle hooks) (make-variable-buffer-local 'yas/trigger-key) (setq yas/trigger-key [tab]) (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand) (define-key yas/keymap [tab] 'yas/next-field)))

Rick Moynihan maintains a git repository (or Eric's fork of the same) with YASnippets for Org-mode.

Org-mode takes over the S-cursor keys. I also want to use CUA-mode, is there a way to fix this conflict?

:PROPERTIES: :CUSTOM_ID: CUA-mode :END:

Yes, see the Conflicts section of the manual.

Org-mode takes over the S-cursor keys. I also want to use windmove.el, is there a way to fix this conflict?

:PROPERTIES: :CUSTOM_ID: windmove.el :END:

Yes, see the Conflicts section of the manual.

Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...

:PROPERTIES: :CUSTOM_ID: loaded-old-org :END:

When this sort of things happen, it probably is because Emacs is loading an old version of Org-mode instead of the one you expected. Check it with M-x org-version.

This happens because Emacs loads first the system org-mode (the one included with Emacs) before the one in your directory. Check the load-path variable; you might see that your org-mode appears after the system-wide path; this is bad.

You should add your directories to the load-path at the beginning:

 (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)

Function add-to-list adds at the beginning. Don't use append because it appends at the end. Also be sure to use (require 'org-install) and not (require 'org).

This wrong version loading may also happen if you have a byte-compiled org.elc from an old version together with a new org.el. Since Emacs prefers loading byte-compiled files (even if the =.el= is newer), it will load the old Org-mode.

Why doesn't org-batch-agenda work under Win32?

:PROPERTIES: :CUSTOM_ID: org-batch-agenda-under-win32 :END:

When I run the example batch files to print my agenda to the console under Win32 I get the failure:

End of file during parsing

and no agenda is printed.

The problem is the use of single quotes surrounding the eval in the emacs command-line. This gets confused under Win32. All string parameters with spaces must be surrounded in double quotes. This means that double quotes being passed to the eval must be escaped.

Therefore, instead of the following:

\emacs.exe -batch -l ~/_emacs_org \
    -eval '(org-batch-agenda "a")'

you need to use the following:

 \emacs.exe -batch -l ~/_emacs_org \
    -eval "(org-batch-agenda \"a\")"

(all on one line, of course).

Org agenda seems very slow

:PROPERTIES: :CUSTOM_ID: slow-agenda :END:

If it takes a long time to generate or refresh the agenda, you might want first check which version of org-mode you are using. There have been major optimizations of org-agenda since 6.21b, which was the version of org-mode released with Emacs 23. If you are using 6.21b or earlier (you can check with M-x org-version), then you might want to consider upgrading to a more recent version of org-mode.

Here are some other ideas for speeding up the agenda:

  1. Use a one day agenda view (rather than a seven day view).

(setq org-agenda-ndays 1)

  1. Archive inactive items to separate files.

C-c C-x C-s (org-archive-subtree)

  1. Do not include the global todo list in your agenda view.

(setq org-agenda-include-all-todo nil)

  1. Make sure that your org files are byte-compiled.

I.e., make sure there are files ending in .elc in your org installation directory.

Visual-line-mode doesn't work well with org-mode

:PROPERTIES: :CUSTOM_ID: visual-line-mode :END:

Visual-line-mode "soft wraps" lines so that the visual edge of the buffer is considered a line break for purposes of navigation, even though there is no line break in reality.

In older versions of org-mode, org-beginning-of-line and org-end-of-line do not work well with visual line mode. (The two commands disregard soft line breaks and move to the beginning and end of the hard line break.) A patch was introduces to fix this behavior in July of 2009. n

If you are using an older version of org mode, you can:

  1. Add a hook to turn off visual line mode.
  1. Add the following to your =.emacs=:

(add-hook 'org-mode-hook (lambda () (define-key org-mode-map "\C-a" 'move-beginning-of-line) (define-key org-mode-map "\C-a" 'move-end-of-line)))

Outline

Can I have two windows on the same Org-mode file, with different outline visibilities?

:PROPERTIES: :CUSTOM_ID: Outline :END: :PROPERTIES: :CUSTOM_ID: indirect-buffers :END:

You may use indirect buffers which do exactly this. See the documentation on the command make-indirect-buffer.

Org-mode has built-in commands that allow you create an indirect buffer from a subtree of an outline. To open a subtree in new window, type C-c C-x b. Any changes you make in the new window will be saved to the original file, but the visibility of both buffers will remain independent of one another.

For multiple indirect buffers from the same file, you must use the prefix C-u when creating the second (or third) buffer. Otherwise the new indirect buffer will replace the old.

You can also create an independent view of an outline subtree by typing b on an item in the agenda.

Emacs outlines are unreadable. Can I get rid of all those stars?

:PROPERTIES: :CUSTOM_ID: Emacs-outlines-are-unreadable :END:

C-k is killing whole subtrees! I lost my work!

See the section Clean outline view in the manual. :PROPERTIES: :CUSTOM_ID: C-k-is-killing-subtrees :END:

(setq org-special-ctrl-k t) before losing your work.

Why aren't commands working on regions?

:PROPERTIES: :CUSTOM_ID: transient-mark-mode :END:

Some org-mode commands, such as M-right and M-left for demoting or promoting headlines (see this FAQ), can be applied to entire regions. These commands, however, will only work on active regions set with transient mark mode. Transient mark mode is enabled by default in Emacs 23. To enable it in earlier versions of emacs, put the following in your =.emacs= file:

(transient-mark-mode 1)

Alternatively, you may turn off transient mark mode and use a momentary mark (C-<SPC> C-<SPC>).

Why is a blank line inserted after headlines and list items?

:PROPERTIES: :ID: 2463F4D8-F686-4CF3-AA07-08976F8A4972 :END: :PROPERTIES: :CUSTOM_ID: blank-line-after-headlines-and-list-items :END:

In org-mode, typing M-RET at the end of a headline will create a new headline of the same level on a new line. The same is true for plain lists. By default org-mode uses context to determine if a blank line should be inserted after each headline or plain list item when M-RET= is pressed. For instance, if a there is a blank line before a headline, then typing =M-RET at the end of the line will insert a blank line before the new headline. For instance, hitting =M-RET= at the end of "Headline Two" below inserts a new headline without a blank line:

** Headline One
** Headline Two
**

If there is a blank line between Headline One and Headline Two, however, the results will be as follows:

** Headline One

** Headline Two

**

If you do not like the default behavior you can change it with the variable org-blank-before-new-entry. You can set headings and/or plain lists to auto (the default setting), t (always), or nil (never).

How can I promote or demote multiple headlines at once?

:PROPERTIES: :CUSTOM_ID: demote-multiple-headlines :END:

If you have a long list of first level headlines that you'd like to demote to second level headlines, you can select the headlines as a region and then hit M-<right> to demote all the headlines at once.

Note: M-S-<right> will not work on a selected region. Its use is to demote a single subtree (i.e., a headline and all sub-headlines).

If M- doesn't seem to work, make sure transient mark mode is enabled. See this FAQ.

What's the deal with all the ellipses in my org outlines?

:PROPERTIES: :CUSTOM_ID: org-ellipses :END:

Org-mode uses ellipses to indicate folded (and thus hidden) text. Most commonly, ellispes occur at the end of headings with folded content:

* Heading ...

Or, for instance, they may indicate closed drawers:

:PROPERTIES: ...

Sometimes, as a result of editing and cycling an outline, ellipses may appear in unexpected places. You should never delete these ellipses, as you may accidentally delete hidden text. Instead, you can type C-c C-r (org-reveal) to display all hidden text in the vicinity. Or you may type M-x RET show-all to reveal all text in the org file.

If you would prefer a symbol or face for indicating hidden text, you can customize the variable org-ellipses.

Todos and Tags

How can I cycle through the TODO keyword of an entry?

:PROPERTIES: :CUSTOM_ID: Todos-and-Tags :END: :PROPERTIES: :CUSTOM_ID: cycle-TODO-keywords :END:

C-c C-t or S-<left/right> is what you need.

How do I track state changes for tasks in Org?

:PROPERTIES: :CUSTOM_ID: track-state-changes-for-tasks :END:

Take a look at the post by Bernt Hansen for setting up TODO keyword states and logging timestamps for task state changes.

Can I select the TODO keywords with a tag-like interface?

:PROPERTIES: :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface :END:

Yes. Use (setq org-use-fast-todo-selection t)

If you want to set both your todos and your tags using a single interface, then check out the variable org-fast-tag-selection-include-todo.

See this section of the manual for more details.

How can I quickly set the tag of an entry?

:PROPERTIES: :CUSTOM_ID: quickly-set-tag-of-entry :END:

Use C-c C-c or C-c C-q on the headline. C-c C-q is useful for setting tabs in a remember buffer, since C-c C-c is the default keybinding for filing a note from the remember buffer.

You can set tags even more quickly by setting one of the character shortcuts for fast tag selection.

To set tag shortcuts for all org buffers, put something like the following in your =.emacs= file (or create the same settings by typing M-x customize-variable RET org-tag-alist):

(setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))

To set tag shortcuts for a single buffer, put something like the following at the top of your org file:

#+TAGS: computer(c) office(o) home(h)

How can I change the colors of TODO keywords?

You can use the variable org-todo-keyword-faces. Here are some sample settings:

(setq org-todo-keyword-faces '( ("TODO" . (:foreground "firebrick2" :weight bold)) ("WAITING" . (:foreground "olivedrab" :weight bold)) ("LATER" . (:foreground "sienna" :weight bold)) ("PROJECT" . (:foreground "steelblue" :weight bold)) ("DONE" . (:foreground "forestgreen" :weight bold)) ("MAYBE" . (:foreground "dimgrey" :weight bold)) ("CANCELED" . shadow) ))

If you want to change the color of all active todos or all inactive todos, type:

M-x customize-face RET org-todo
M-x customize-face RET org-done

You can also set values for each of these in your =.emacs= file:

(set-face-foreground 'org-todo "firebrick2")
(set-face-foreground 'org-done "forestgreen")

Hyperlinks

:PROPERTIES: :CUSTOM_ID: Hyperlinks :END: :PROPERTIES: :CUSTOM_ID: confirm-shell/elisp-link :END:

The confirmation is there to protect you from unwantingly execute potentially dangerous commands. For example, imagine a link

[[shell:rm -rf ~/*][Google Search]]

In an Org-mode buffer, this command would look like Google Search, but really it would remove your home directory. If you wish, you can make it easier to respond to the query by setting

(setq org-confirm-shell-link-function 'y-or-n-p
      org-confirm-elisp-link-function 'y-or-n-p).

Then a single keypress will be enough to confirm those links. It is also possible to turn off this check entirely, but I strongly recommend against this. Be warned.

:PROPERTIES: :CUSTOM_ID: RET-or-TAB-to-follow-link :END:

Yes, this is how:

(setq org-return-follows-link t)
(setq org-tab-follows-link t)

:PROPERTIES: :CUSTOM_ID: mouse-1-following-link :END:

Activating links with mouse-1 is a new feature in Emacs 22, to make link behavior similar to other applications like web browsers. If you hold the mouse button down a bit longer, the cursor will be set without following the link. If you cannot get used to this behavior, you can (as in Emacs 21) use mouse-2 to follow links and turn off link activation for mouse-1 with

(setq org-mouse-1-follows-link nil)

:PROPERTIES: :CUSTOM_ID: completion-of-file-links :END:

You can use org-insert-link with a prefix argument:

C-u C-c C-l

You will be greeted with prompt in the minibuffer that allows for file completion using your preferred Emacs method for finding files.

Plain Lists

How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?

:PROPERTIES: :CUSTOM_ID: Plain-Lists :END: :PROPERTIES: :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item :END:

(setq org-blank-before-new-entry
      '((heading . t) (plain-list-item . nil))

See also Why is a blank line inserted after headlines and list items?.

How can I convert itemized lists to enumerated lists?

:PROPERTIES: :CUSTOM_ID: convert-itemized-to-enumerated-lists :END:

You can use C-c - or S-<left>/<right> to cycle through the various bullet headlines available for lists: -, +, *, 1., 1).

See this section of the manual for more information.

How can I convert plain lists to headlines and vice versa?

:PROPERTIES: :CUSTOM_ID: convert-plain-lists-to-headlines :END:

To convert a plain list item or line to a headline, type C-c * on the headline. This will make the line a subheading of the current headline.

To convert a headline to a plain list item, type C-c - while the cursor is on the headline.

To convert a headline to an unadorned line of text, type C-c * on the headline.

You can use query replace to accomplish the same things, as Bernt Hansen explains in this mailing list post.

Is there a good way to create a description list?

:PROPERTIES: :CUSTOM_ID: description-lists :END:

Yes, these are now built-in:


- item1 :: Description of this item 1
- item2 :: Description of this item 2
- item1 :: Description of this item 3
      also in multiple lines

Tables

Can I plot data from a table?

:PROPERTIES: :CUSTOM_ID: Tables :END: :PROPERTIES: :CUSTOM_ID: plotting-table-data :END:

Yes, you can, using org-plot.el written by James TD Smith and now bundled with Org. See the manual section about this.

See also this excellent tutorial by Eric Schulte.

How can I fill a table column with incremental numbers?

:PROPERTIES: :CUSTOM_ID: fill-table-column-with-incremental-numbers :END:

Here is how: Use a field formula to set the first value in the column:

,| N | | ,|-----+---| ,| :=1 | | ,| | | ,| | | ,| | | ,#+TBLFM: @2$1=1

Then define a column formula in the second field:

,| N | | ,|----------+---| ,| 1 | | ,| =@-1 + 1 | | ,| | | ,| | | ,#+TBLFM: @2$1=1

After recomputing the table, the column will be filled with incremental numbers:

,| N | | ,|---+---| ,| 1 | | ,| 2 | | ,| 3 | | ,| 4 | | ,#+TBLFM: $1=@-1 + 1::@2$1=1

Note that you could use arbitrary starting values and column formulas.

Why does my table column get filled with #ERROR?

:PROPERTIES: :CUSTOM_ID: table-column-filled-with-ERROR :END:

Org-mode tried to compute the column from other fields using a formula stored in the #+TBLFM: line just below the table, and the evaluation of the formula fails. Fix the fields used in the formula, or fix the formula, or remove it!

How can I stop the table editor from creating new lines?

:PROPERTIES: :CUSTOM_ID: table-editor-creates-new-lines :END:

When I am in the last column of a table and just above a horizontal line in the table, pressing TAB creates a new table line before the horizontal line. To move to the line below the horizontal line instead, do this:

Press down (to get on the separator line) and then TAB. Or configure the variable

(setq org-table-tab-jumps-over-hlines t)

How can I get table fields starting with "="?

:PROPERTIES: :CUSTOM_ID: table-fields-starting-with-= :END:

With the setting

(setq org-table-formula-evaluate-inline nil)

this will no longer happen. You can still use formulas using the commands @C-c =@ and @C-u C-c =@

How can I change the indentation of an entire table without fixing every line by hand?

:PROPERTIES: :CUSTOM_ID: change-indentation-entire-table :END:

The indentation of a table is set by the first line. So just fix the indentation of the first line and realign with TAB.

In my huge table the realigning after each TAB takes too long. What can I do?

:PROPERTIES: :CUSTOM_ID: table-realigning-after-TAB-takes-long :END:

Either split the table into several by inserting an empty line every 100 lines or so. Or turn off the automatic re-align with

(setq org-table-automatic-realign nil)

After this the only way to realign a table is to press C-c C-c. It will no longer happen automatically, removing the corresponding delays during editing.

Recalculation of my table takes too long. What can I do?

:PROPERTIES: :CUSTOM_ID: Recalculation-of-my-table-takes-too-long :END:

Nothing, really. The spreadsheet in org is mostly done to make calculations possible, not so much to make them fast. Since Org-mode is firmly committed to the ASCII format, nothing is stopping you from editing the table by hand. Therefore, there is no internal representation of the data. Each time Org-mode starts a computation, it must scan the table for special lines, find the fields etc. This is slow. Furthermore, Calc is slow compared to hardware computations. To make this work with normal editing, recalculation is not happening automatically, or only for the current line, so that the long wait for a full table iteration only happens when you ask for it.

So for really complex tables, moving to a "real" spreadsheet may still be the best option.

That said, there are some ways to optimize things in Org-mode, and I have been thinking about moving a bit further down this line. However, for my applications this has so far not been an issue at all. If you have a good case, you could try to convince me.

S-RET in a table keeps increasing the copied numbers. How can I stop this?

:PROPERTIES: :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers :END:

Well, it is supposed to be a feature, to make it easy to create a column with increasing numbers. If this gets into your way, turn it off with

(setq org-org-table-copy-increment nil)

When I export tables to html, they don't have borders.

:PROPERTIES: :CUSTOM_ID: table-borders-in-html-export :END:

By default, org mode exports tables without borders.

You can changed this by placing an #+ATTR_HTML line before the table:

 #+ATTR_HTML: border="2" rules="all" frame="all"

See the manual for more details.

Markup

How can I get automatic renumbering of footnotes in org-mode?

:PROPERTIES: :CUSTOM_ID: Footnotes :END: :PROPERTIES: :CUSTOM_ID: footnote-auto-adjust :END:

You can add the following line to your .emacs file:

(setq org-footnote-auto-adjust t)

Or, if you prefer, you can turn this option on locally by placing the following line at the top of your org file:

#+STARTUP: fnadjust

When auto-adjust is turned on, footnotes in the file with numerical labels will be renumbered whenever a new footnote is added. Meanwhile, all footnotes, including those with custom labels such =[fn:custom-label ]=, will be sorted in the order of their appearance in the text.

This emulates the footnote behavior that many users may be familiar with from word-processing programs or from the footnote-mode included with emacs.

If you do not turn on org-footnote-auto-adjust, you sort and/or renumber footnotes at any time by calling org-footnote-action with a prefix argument.

Why isn't auto renumbering of footnotes turned on by default?

:PROPERTIES: :CUSTOM_ID: why-no-default-auto-adjust :END:

Org mode has a very robust footnote mechanism allowing for a variety of types of footnotes. With some of the following footnote notations, auto-adjust may be either irrelevant or undesired:

  • Automatically numbered
  • Footnotes with custom labels
  • Inline footnotes

In addition, org mode can be customized to place footnotes either at the end of a document or at the end of the outline heading in which they appear. Users who change this setting while editing a document may be disconcerted to find all of their footnotes rearranged automatically.

I have auto-fill-mode set and org-mode is inserting unwanted comment markers!

:PROPERTIES: :CUSTOM_ID: auto-fill-and-unwanted-comments :END:

If the following occurs:

Some entered text.

Make sure that the variable comment-start is nil.

Remember

Can I use the remember buffer to clock a customer phone call?

:PROPERTIES: :CUSTOM_ID: Remember :END: :PROPERTIES: :CUSTOM_ID: use-remember-buffer-to-clock-phone-call :END:

Can I automatically start the clock when opening a remember template?

Yes, you can. Take a look at the setup described by Bernt Hansen and check out (in the same thread) what Nick Docos had to fix to make Bernt's set-up work for him. :PROPERTIES: :CUSTOM_ID: start-clock-when-opening-remember-template :END:

Yes, this is possible. Use the following code and make sure that after executing it, `my-start-clock-if-needed' is in `remember-mode-hook' after `org-remember-apply-template'.

(add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
(defun my-start-clock-if-needed ()
  (save-excursion
    (goto-char (point-min))
    (when (re-search-forward " *CLOCK-IN *" nil t)
      (replace-match "")
      (org-clock-in))))

Then, when a template contains the key string CLOCK-IN, the clock will be started. Starting with Org-mode version 5.20, the clock will automatically be stopped when storing the remember buffer.

Searches

:PROPERTIES: :CUSTOM_ID: Searches :END: :PROPERTIES: :CUSTOM_ID: isearch-in-links :END:

M-x visible-mode will display the full link, making them searchable.

How can I reduce the amount of context shown in sparse trees?

:PROPERTIES: :CUSTOM_ID: context-in-sparse-trees :END:

Take a look at the following variables:

  • org-show-hierarchy-above
  • org-show-following-headline
  • org-show-siblings
  • org-show-entry-blow

which give command-dependent control over how much context is shown by a particular operation.

How can I combine the results of two calls to org-occur?

:PROPERTIES: :CUSTOM_ID: two-calls-to-org-occur :END:

You can construct a regular expression that matches all targets you want. Alternatively, use a C-u prefix with the second and any further calls to org-occur to keep the current visibility and highlighting in addition to the new ones.

Agenda

How can I change the advanced warning time for deadlines?

:PROPERTIES: :CUSTOM_ID: Agenda :END: ##<>

Deadline warnings appear in the daily agenda view a specified number of days before the deadline is due. The default setting is 14 days. You can change this with the variable org-deadline-warning-days. (See this section of the manual.)

For instance,

(setq org-deadline-warning-days 30)

would cause warnings for each deadline to appear 30 days in advance.

Naturally, you might not want warnings for all of your deadlines to appear so far in advance. Thus, you can change the lead time for individual items as follows:

* TODO Get a gift for the party
  DEADLINE: <2009-01-16 Fri -2d>

How can I postpone a task until a certain date?

The "-2d" above changes the lead time for this deadline warning to two days in advance. You can also use "w" for weeks and "m" for months. :PROPERTIES: :CUSTOM_ID: deferring-tasks :END:

The easiest way to postpone a task is to schedule it in the future. For instance, typing C-c C-s +2w on a headline will push a task two weeks into the future, so that it won't show up on the daily agenda until two weeks from now.

If you'd like to prevent the task from showing up on your global todo list, you have a couple of options.

Can I send myself an email containing tasks or other agenda info?

  1. You can set the variable org-agenda-todo-ignore-scheduled to t.
  2. This will exclude any scheduled items from your global list of active todos (=C-c a t=). (The variable =org-agenda-todo-ignore-with-date= will exclude both scheduled and deadline items from your todo list).
  3. You can remove the todo keyword from the item (C-c C-t ). The
  4. item will still appear on your agenda two weeks from today, but it won't show up on your todo lists. :PROPERTIES: :CUSTOM_ID: email-containing-tasks-or-other-agenda-info :END:

Yes. See this thread on the list.

How can I limit the agenda view to my "work" tasks?

:PROPERTIES: :CUSTOM_ID: limit-agenda-with-tag-filtering :END:

It is often convenient to group org files into separate categories, such as "home" and "work" (or "personal" and "professional"). One of the main reasons for such classification is to create agenda views that are limited by type of work or area of responsibility. For instance, while at work, one may want to see only professional tasks; while away from work, one may want to see only personal tasks.

One way to categorize files and tasks is to use a "#+FILETAGS" declaration at the top of each file, such as:

#+FILETAGS: work

As long as org-use-tag-inheritance is turned on, the filetags will be inherited by all tasks in the file. A file can have multiple filetags. And, of course, tags can be added to individual headings.

Tasks can be quickly filtered by tag from within the agenda by typing "/" and the name of the tag. The full key sequence to filter for work items in an agenda view would be:

C-c a a / work [or a tag shortcut]

How can I limit the agenda view to a particular category?

:PROPERTIES: :CUSTOM_ID: limit-agenda-with-category-match :END:

Another way to filter agenda views by type of work is to use a "#+CATEGORY" declaration at the top of each file, such as:

#+CATEGORY: work

Categories can also be added to individual headings within a file:

* Big project
  :PROPERTIES:
  :CATEGORY: work
  :END:

All todos belonging to the category "work" can be found a with a simple tags-todo search:

C-c a M

At the prompt, type:

CATEGORY="work"

The same results can be achieved with custom agenda commands, such as:


(setq org-agenda-custom-commands
      '(("h" tags-todo "CATEGORY=\"home\"")
	("w" tags-todo "CATEGORY=\"work\"")
	;; other custom agenda commands here
	))

How can include all org files in a directory in my agenda?

:PROPERTIES: :CUSTOM_ID: set-agenda-files-using-wildcards :END:

You can simply set the value of org-agenda-files to a directory rather than a list of files:

(setq org-agenda-files "~/my/special/path/org/")

Why aren't items disappearing from my agenda once they are marked done?

:PROPERTIES: :CUSTOM_ID: removing-done-items-from-agenda :END:

If items remain on your daily/weekly agenda after they are marked done, check the configuration of the following variables:

org-agenda-skip-scheduled-if-done
org-agenda-skip-deadline-if-done
org-agenda-skip-timestamp-if-done

For instance, type:

M-x customize-variable RET org-agenda-skip-scheduled-if-done

If this variable is turned off (nil), then scheduled items will remain on the agenda even after they are marked done.

If the variable is turned on (t), then scheduled items will disappear from the agenda after they are marked done.

If these settings seem not to behave the way you expect, then make sure you understand the difference between SCHEDULED, DEADLINE, and timestamps.

What is the difference between SCHEDULED, DEADLINE, and plain timestamps?

:PROPERTIES: :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp :END:

  1. SCHEDULED items (set with C-c C-s) will appear on your agenda on
  2. the day they are scheduled and on every day thereafter until they are done. Schedule a task if you want to be reminded to do something beginning on a certain day and until it is done.

** TODO Scheduled item

SCHEDULED: <2009-03-01 Sun>
  1. Items with a DEADLINE timestamp (set with C-c C-d) appear on your
  2. agenda in advance of the when they are due and remain on your agenda until they are done. Add a DEADLINE to an item if you want to make sure to complete it by a certain date. (The variable org-deadline-warning-days determines how far in advance items with deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more information.)

** TODO Item with a deadline

DEADLINE: <2009-01-20 Tue>
  1. An active timestamp (set with C-c .) will appear on your agenda
  2. only on the day it is scheduled. Use a timestamp for appointments or any reminders you want to show up only on a particular day.

** TODO Item with an active timestamp

<2009-04-18 Sat>

Note: items with inactive timestamps (set with C-c ! and marked by square brackets) will not show up in the agenda at all.

Can I add files recursively to my list of agenda files?

:PROPERTIES: :CUSTOM_ID: set-agenda-files-recursively :END:

Yes, you can use the library "find-lisp."

(load-library "find-lisp")
(setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))

This will add all files ending in org in the directory "~/org" and all of its subdirectories to your list of agenda files.

See this thread on the mailing list for more information.

Why does an item appearing at the wrong time of day in my agenda?

:PROPERTIES: :CUSTOM_ID: agenda-wrong-time-of-day :END:

When preparing the agenda view, org-mode scans each relevant headline for a time designation. This approach is very nice for adding free-form timestamps to an item for scheduling. Thus, either of the following work would work to schedule an item at 10:00am:

,** 10:00am Get dried ice at the magic store , SCHEDULED: <2009-05-27 Wed>

,** Get dried ice at the magic store , SCHEDULED: <2009-05-27 Wed 10:00>

To enable this flexibility, org-mode scans the entire headline for time of day notation. A potential problem can arise if you use inactive timestamps in the headline to note when an item was created. For example,

,** Get dried ice at the magic store [2009-05-26 Tue 12:58] , SCHEDULED: <2009-05-27 Wed>

Org mode would interpret the time in the inactive timestamp as a time-of-day indicator and the entry would appear in your agenda at 12:58.

If you would like to turn off the time-of-day search, you can configure the variable org-agenda-search-headline-for-time (requires org-mode >= 6.24).

Appointments/Diary

Is it possible to include entries from org-mode files into my emacs diary?

:PROPERTIES: :CUSTOM_ID: Appointments/Diary :END: :PROPERTIES: :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary :END:

Since the org-mode agenda is much more powerful and can contain the diary, you should think twice before deciding to do this. If you insist, however, integrating Org-mode information into the diary is possible. You need to turn on fancy diary display by setting in .emacs:

(add-hook 'diary-display-hook 'diary-fancy-display)

Then include the following line into your ~/diary file, in order to get the entries from all files listed in the variable org-agenda-files

&%%(org-diary)

You may also select specific files with

&%%(org-diary) ~/path/to/some/org-file.org
&%%(org-diary) ~/path/to/another/org-file.org

I want to add my Org scheduled/deadlined entries in my diary!

If you now launch the calendar and press @d@ to display a diary, the headlines of entries containing a timestamp, date range, schedule, or deadline referring to the selected date will be listed. Just like Org-mode's agenda view, the diary for today contains additional entries for overdue deadlines and scheduled items. See also the documentation of the org-diary function. Under XEmacs, it is not possible to jump back from the diary to the org, this works only in the agenda buffer. :PROPERTIES: :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary! :END:

Put this in your ~/.diary:

&%%(org-diary :scheduled :timestamp :deadline)

How can I set up automatic reminders based on Org information?

:PROPERTIES: :CUSTOM_ID: automatic-reminders :END:

How can I make appt notice my Org appointments?

See this post by N. Dokos on the list. :PROPERTIES: :CUSTOM_ID: appt-notice-my-Org-appointments :END:

M-x org-agenda-to-appt RET

How can I shedule an weekly appointment that lasts only until a certain date?

:PROPERTIES: :CUSTOM_ID: diary-sexp-in-org-files :END:

Org-mode's active timestamps work very well for scheduling individual or recurring appointments, such as:

* 8:00am Dentist appointment <2009-01-16 Fri>

or

* Weekly meeting with boss
  <2009-01-20 Tue 14:00 +1w>

Sometimes, however, you need to set up more complicated recurring appointments. Org-mode has built-in support for many of the powerful sexp entries that work in Emacs diary. Let's say, for instance, that you teach a class that meets every Monday evening between February 16 and April 20, 2009. The way to enter this an org-mode file is:

** Class 7:00pm-9:00pm
<%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>

The expression above designates all Mondays (1) that fall between February 16 and April 20.

For more ideas on how to create such expressions, see this page on the Emacs wiki.

How can I set an event to occur every day except saturday and sunday?

#+begin_example ** Daily meeting SCHEDULED: <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))> #+end_example

Export

Can I get TODO items exported to HTML as lists, rather than as headlines?

:PROPERTIES: :CUSTOM_ID: Export :END: :PROPERTIES: :CUSTOM_ID: export-TODO-items-as-lists :END:

If you plan to use ASCII or HTML export, make sure things you want to be exported as item lists are level 4 at least, even if that does mean there is a level jump. For example:

* Todays top priorities
**** TODO write a letter to xyz
**** TODO Finish the paper
**** Pick up kids at the school

Alternatively, if you need a specific value for the heading/item transition in a particular file, use the #+OPTIONS line to configure the H switch.

#+OPTIONS:   H:2; ...

Can I export only a single subtree?

:PROPERTIES: :CUSTOM_ID: export-single-subtree :END:

If you want to export a subtree, mark the subtree as region and then export. Marking can be done with C-c @ C-x C-x, for example.

How can I tell my calendar web application about appointments in my agenda files?

Here is what you need to do:

  1. a script that calls Emacs in batch mode and produce a .ics file
  2. a script that uploads this .ics file somewhere on the web
  3. tell your webapp to fetch this .ics file on the web

Here is the script I use for the first step:

#!/bin/bash

/usr/local/bin/emacs --batch --eval \ "(progn (load-file \"~/install/git/org-mode/org.el\") \ (load-file \"~/elisp/config/org-batch-config.el\") \ (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\") (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \ -f org-export-icalendar-combine-agenda-files

Depending on your configuration, you might change the load sequence.

Here is the script I use for the second step:

#!/bin/bash /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/

Note: if you want to cron this rsync script, you will need to let =my_server= to know about your SSH public key. Check this page as a starter.

Now you can cron the two scripts above and your webapp will always be up to date with your Org agendas.

Also see Exporting agenda views from Org manual.

How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?

:PROPERTIES: :CUSTOM_ID: iCal-import-ics-files-old :END:

When using iCal under Apple MacOS X Tiger, you can create a new calendar OrgMode (the default name for the calendar created by C-c C-e c, see the variables org-icalendar-combined-name and org-combined-agenda-icalendar-file). Then set Org-mode to overwrite the corresponding file ~/Library/Calendars/OrgMode.ics. You may even use AppleScript to make iCal re-read the calendar files each time a new version of OrgMode.ics is produced. Here is the setup needed for this:

(setq org-combined-agenda-icalendar-file
    "~/Library/Calendars/OrgMode.ics")
(add-hook 'org-after-save-iCalendar-file-hook
 (lambda ()
  (shell-command
   "osascript -e 'tell application \"iCal\" to reload calendars'")))

How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?

:PROPERTIES: :CUSTOM_ID: iCal-import-ics-files-new :END:

For Mac OS X 10.4, you need to write the ics file to /Library/WebServer/Documents/ and then subscribe iCalendar to http: //localhost/orgmode.ics

How can I remove timestamps and todo keywords from my exported file?

:PROPERTIES: :CUSTOM_ID: export-options-remove-timestamps :END:

You can place an options line at the top of your org file:

#+OPTIONS: <:nil todo:nil

There is a whole host of export options you can set with an in-buffer options or via global variables. See this section of the manual for a full list.

How can I preserve faces when I export an agenda from the command line?

:PROPERTIES: :CUSTOM_ID: preserving-faces-during-batch-export :END:

Normally, when you export an org file or an agenda view from within emacs, htmlize will convert your face definitions to direct color css styles inlined into each <span> object, resulting in an HTML output that preserves the general look of your Org buffers and agenda views.

Let's say you generate an export from the command line, such as the following:

emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'

or

emacs -batch -l ~/.emacs -eval '(org-publish-all)'

In such an instance, the exported HTML will contain only very basic color styles. The reason is that when Emacs is run in batch mode, it does not have a display and therefore only rudimentary face definitions. If you'd like to use more complex styles, you'll have to make sure that the export process only assigns classes instead of direct color values. This can be done by binding the variable =org-export-htmlize-output-style= to css for the duration of the export, for example with

emacs -batch -l ~/.emacs
  -eval '(let ((org-export-htmlize-generate-css (quote css)))
           (org-batch-agenda "e"))'

Then you can use a style file to make these classes look any way you like. To generate face definitions for a CSS file based on any faces you are currently using in Emacs, you can use the following command:

M-x org-export-htmlize-generate-css RET

This will generate a <style>...</style> section, the content of which you can add to your style file.

How can I avoid dark color background when exporting agenda to ps format?

:PROPERTIES: :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda :END:

Add this to your .emacs and evaluate it.


  (setq org-agenda-exporter-settings
        '((ps-print-color-p 'black-white)))

How can I get colored source code when exporting to LaTeX?

:PROPERTIES: :CUSTOM_ID: fontified_source_code_w_latex :END:

As of Sun Aug 9 2009 the "current" version of Org-mode (see keeping-current-with-Org-mode-development) supports exporting source code to LaTeX using the listings package.

To turn on listing export add the following to your Org-mode customization.

;; requite org-latex so that the following variables are defined (require 'org-latex)

;; tell org to use listings (setq org-export-latex-listings t)

;; you must include the listings package (add-to-list 'org-export-latex-packages-alist '("" "listings"))

;; if you want colored source code then you need to include the color package (add-to-list 'org-export-latex-packages-alist '("" "color"))

The listings package will now be used to fontify source code in your LaTeX documents. By default listings will not color any of your source code. If you would like to set colors for keywords and comments in your latex documents you can do so using LaTeX directives like the following.

\lstset{keywordstyle=\color{blue}, commentstyle=\color{red}, stringstyle=\color{green} }

of if you want to get even fancier with your colors you can try something like the following

\definecolor{keywords}{RGB}{255,0,90} \definecolor{comments}{RGB}{60,179,113} \definecolor{fore}{RGB}{249,242,215} \definecolor{back}{RGB}{51,51,51} \lstset{ basicstyle=\color{fore}, keywordstyle=\color{keywords}, commentstyle=\color{comments}, backgroundcolor=\color{back} }

For more complex listings use cases consult the listings manual.

How can I export to Latex Beamer

:PROPERTIES: :CUSTOM_ID: beamer :END: The latex Beamer Class is a useful class for generating slide shows. The following can be used to export Org-mode documents to LaTeX beamer.

Add the following to your Emacs initialization file.

(unless (boundp 'org-export-latex-classes) (setq org-export-latex-classes nil)) (add-to-list 'org-export-latex-classes '("beamer" "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n" ("\\section{%s}" . "\\section*{%s}") ("\\begin{frame}\\frametitle{%s}" "\\end{frame}" "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))

Then by placing

#+LaTeX_CLASS: beamer

in the header of your Org-mode document it will automatically export to the Beamer document class on LaTeX export. With the above configuration top-level headers will be mapped to sections in the Beamer document, second-level headers will be mapped to frames, and lower level headlines will be mapped to itemize objects.

This above is adapted from an email by Nick Dokos, and an email by Thomas Dye. For a much more complex Beamer setup see the email by Thomas Dye.

COMMENT HTML style specifications

(defun org-faq-make-target () "Make hard target for current headline." (interactive) (if (not (org-on-heading-p)) (error "Not on a headline")) (let ((h (org-trim (org-get-heading 'no-tags)))) (if (string-match "[ \t]*\\?\\'" h) (setq h (replace-match "" t t h))) (while (string-match "[ \t]+" h) (setq h (replace-match "-" t t h))) (org-entry-put nil "CUSTOM_ID" h)))