Fix broken link
[Worg.git] / org-faq.org
blob67da8d4749b883bbf1ff34992b53060c5200e55e
1 #+STARTUP:   overview
2 #+OPTIONS:   H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t
3 #+EMAIL:     carsten.dominik@gmail.com
4 #+AUTHOR:    Worg people
5 #+LANGUAGE:  en
6 #+TITLE:     Org-mode Frequently Asked Questions
7 #+INFOJS_OPT: view:content toc:1 path:http://orgmode.org/worg/code/org-info-js/org-info.js tdepth:1 ftoc:t buttons:0 mouse:underline
8 #+OPTIONS:   H:3 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
10 #+begin_html
11 <a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
12 #+end_html
14 [[file:index.org][{Back to Worg's index}]]
16 * Welcome
17   :PROPERTIES:
18   :CUSTOM_ID: Welcome
19   :END:
21 Welcome to the Org-mode FAQ.
23 You can navigate the FAQ by clicking on any of the topics in the Table
24 of Contents.
26 If your browser supports JavaScript, you can...
28 - move through the topics by typing "=n=" (next) and "=p=" (previous).
30 - see an outline view of the FAQ by typing "=m=" or clicking "=toggle
31   view=" (above).
33 - search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
35 - see a full list of navigation commands by typing "=?=" or clicking
36   "=Help=" (above).
38 * What is org-mode?
39   :PROPERTIES:
40   :CUSTOM_ID: What-is-org-mode
41   :END:
42 ** Can I implement a GTD workflow with Org-mode?
43    :PROPERTIES:
44    :CUSTOM_ID: GTD-workflow-with-Org-mode
45    :END:
47    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.php][here]].
49 ** What is the difference between Org and TaskPaper?
50    :PROPERTIES:
51    :CUSTOM_ID: Org-and-TaskPaper
52    :END:
54   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
55   is just that, when using Org within Emacs, it lets you do many things
56   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
57   fiddle-proof and people using Emacs tends to like fiddling (which is
58   orthogonal to the idea of using todo-list efficiently), but this is
59   just a matter of discipline and common sense, not one of Org's design.
61   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
62 ** What is the meaning of the Unicorn on Org's website?
63    :PROPERTIES:
64    :CUSTOM_ID: unicorn
65    :END:
67 The Unicorn is the logo of Org-mode because:
69 - Org-mode is the UNICs of ORgaNizers.
71 - Org-mode is an Emacs mode, so it makes sense to use an animal
72   similar or related to the gnu used for GNU Emacs.
74 - Org-mode is meant to show you the way, and an animal with two horns
75   can not do this very well, can it?
77 - Unicorn tears are said to reverse petrification, and wasn't this how
78   we all felt before getting to some degree of time and task
79   management?
81 - It will take forever to learn everything there is to know about a
82   unicorn.
84 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
85   creation.
87 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
88 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
89 gave it a refresh some time later.  Bastien writes why he chose a
90 unicorn:
92 #+BEGIN_QUOTE
93 The first reason is not linked to the animal, but to the sounding of the
94 word "Unicorn" - because Org gives you a /uni/que way of producing files
95 in several format (HTML, LaTeX, etc.)
97 The second reason is that a Unicorn doesn't really exist, it is just
98 something you can dream about, and make others believe it does exist.
99 Just like the perfect organizer.
100 #+END_QUOTE
102 There was a [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][thread about unicorns]] on the mailing list.  [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][Christopher
103 Suckling]] posted a link showing how to make a simple foldable unicorn
104 (very appropriate for an outlining program!).
106 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
107 possession of the Org-mode author.
109 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
110   This logo is available in a number of different formats including
111   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
113 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
115 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[http://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
117 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][Stefan Vollmar]] made a [[http://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[http://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
118   threshold technique".
120 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
121   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
123 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
125 * Mailing list
126 ** Why hasn't my email to the mailing list shown up yet?
127    :PROPERTIES:
128    :CUSTOM_ID: ml-post-delay
129    :END:
131 The org-mode mailing list is moderated. Thus, if you are not
132 subscribed to the mailing list, your mail will only appear on the list
133 after it has been approved by a moderator. To ensure that your mail
134 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
136 ** I read the mailing list through gmane. Should I subscribe?
137    :PROPERTIES:
138    :CUSTOM_ID: ml-subscription-and-gmane
139    :END:
141 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
142 participants in the list prefer read the list in a newsreader, such as
143 Gnus, instead of receiving emails. If you choose to read the list via
144 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
145 any emails on the mailman settings page (see the "Mail Delivery"
146 setting).
148 This will ensure that your messages to the list get through quickly,
149 reduce the work load of the mailing list moderators (who need to clear
150 every mail from non-members), and provide more accurate information
151 about the number of list readers.
153 * Keeping current
154   :PROPERTIES:
155   :CUSTOM_ID: Keeping-current
156   :END:
157 ** How do I keep current with Org mode development?
158    :PROPERTIES:
159    :CUSTOM_ID: keeping-current-with-Org-mode-development
160    :END:
162    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]].  You can keep up-to-date with Org
163    mode developement by cloning Org mode repository and refreshing
164    your copy with latest changes whenever you wish.  You only need to
165    use two Git commands (clone and pull.)  Here are the steps in
166    brief (please customize locations to suit your setup):
168    1. Select a location to house the Org mode repository (approx. 40
169       MB; includes documentation, compiled elisp files and history
170       going all the way back to v4.12a)
172       : $ mkdir $HOME/elisp && cd $HOME/elisp
174    2. Clone the Org mode Git repository.
176       Recommended approach:
178       : $ git clone git://repo.or.cz/org-mode.git
180       Alternate approach if you are behind a firewall that allows only
181       HTTP (can be quite slow):
183       : $ git clone http://repo.or.cz/r/org-mode.git
185    3. Compile and install Org mode and build documentation.
187       : $ cd org-mode && make && make doc && make install
189       Please note that you can choose to /not/ compile at all and run
190       using source =.el= files only.  Compiled files speed things up.
192    4. This is where you configure Org mode with Emacs.  Please refer
193       to [[./org-tutorials/index.org][Org tutorials]].
195    5. Keeping up-to-date.
197       Cloning the repository is a one time activity.  From this point
198       onwards you only need to /pull/ the latest changes.
200       : $ cd $HOME/elisp/org-mode
202       and then
204       : $ git pull && make clean && make && make doc && make install
206    6. You should restart org mode to have the changes take effect (if
207       you are not rebooting Emacs.)  Also since the intention is to
208       "keep up" with Org mode, you should visit updated sections of
209       documentation for latest updates (use =git log=.)
211    7. As you use your repository over time it will accumulate loose objects.
212       You can reduce the total size of your git repository with
214       : $ git gc
216       which will consolidate loose git objects into pack files.  This
217       reduces the size of the repository and speeds up data access to
218       the objects.
220 ** How can I keep local changes and still track Org mode development?
221    :PROPERTIES:
222    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
223    :END:
225   Say you want to make minor changes to the Makefile to reflect your
226   location for =emacs=.
228   Create a local branch for your changes on top of origin/master as
229   follows:
231   : $ git checkout -b local origin/master
232   : $ git config branch.local.rebase true
233   : # Make your changes to the Makefile and create a new commit
234   : $ git add Makefile
235   : $ git commit -m 'My local Makefile configurations'
236   : # Update git to a newer version
237   : $ git pull
239   Now each time you pull new commits from the distribution repository
240   your local commits will be rewound and replayed on top of the new
241   origin/master.
243 -----------
245   You would normally work on your =local= branch which includes your
246   custom commits; there's no need to switch back to the =master=
247   branch.
249 -----------
251 Here is an example of dealing with conflict resolution during git pull.
253 If you get a conflict during a =git pull= you will need to edit the
254 file with the conflict to fix up the conflicting lines and then tell
255 git that you have resolved the conflict.
257 Conflict resolution goes something like this:
259 1. =git pull= fails with a conflict
260 2. edit the file
261 3. =git add= the file to mark the conflict resolved
262 4. =git rebase --continue=
263 5. lather, rinse, and repeat 2-4 as needed
265 For this example we have the following Makefile:
267 : #
268 : # Example Makefile
269 : #
271 : EMACS=emacs
273 : VERSION=V1.0
275 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
276 make it work well on our system.
278 To do this we
280   - create a local branch for our work
282     : $ git checkout -b local origin/master
283     : $ git config branch.local.rebase true
285     This marks the branch so that all local commits on it are rebased
286     on top of any new commits we get in origin/master during a =git
287     pull= operation.
289   - Make our custom changes
291     Edit the makefile so it looks like this:
293     : #
294     : # Example Makefile
295     : #
296     :
297     : EMACS=myemacs
298     :
299     : VERSION=V1.0
301   - Create a commit with our custom changes
302     : $ git add Makefile
303     : $ git commit -m 'My local Makefile configurations'
305   - Later we do a =git pull= but that fails with conflicts.
307     : $ git pull
308     : remote: Counting objects: 5, done.
309     : ...
310     : Patch failed at 0001.
311     :
312     : When you have resolved this problem run "git rebase --continue".
313     : If you would prefer to skip this patch, instead run "git rebase --skip".
314     : To restore the original branch and stop rebasing run "git rebase --abort".
316   - Fix the conflict in your favourite editor
318     Conflict markers look like this:
320     : <<<<<<< HEAD:Makefile
321     : EMACS=emacs22
322     : =======
323     : EMACS=myemacs
324     : >>>>>>> Change emacs location:Makefile
326     This attempted =git pull= caused a conflict.  Fire up your
327     favourite editor and fix the conflict in the Makefile.  The
328     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
329     the Makefile appropriately and delete the conflict markers.  You
330     already edited these lines earlier so fixing it should be trivial.
332     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
333     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
334     file and save it by deleting the conflict markers and keeping the
335     code you need (in this case the =EMACS=myemacs= line which we
336     originally modified.)
338   - Mark the file's conflict resolved
340     : $ git add Makefile
342     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.
344   - Continue the rebase operation
346     : $ git rebase --continue
348     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
350 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"
351 using
352 : $ git rebase --abort
355 ** How can I use a stable release version instead of the bleeding edge master?
356    :PROPERTIES:
357    :CUSTOM_ID: using-stable-releases-only
358    :END:
360 The master branch of the git repository always contains the bleeding
361 edge development code.  This is important for Org's fast development,
362 because code on master gets checked out by many people daily and we
363 quickly receive bug reports if something is wrong.  On rare occasions,
364 this code may not function perfectly for a limited time while we are
365 trying to fix things.
367 Not everyone like to use this bleeding-edge code and face the danger
368 to hit a surprising bug.
370 Therefore, from time to time, we make a release.  This typically
371 happens when the maintainers feel that 
373 1. they have reached a good point in the development
374 2. the code has a feature set that should stay and be supported in the
375    future
377 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
378 Org, and they are also the code that gets merged into the Emacs
379 distribution.  If you want to work only with stable releases, you can
380 still use the git repository to do so.
382 *** Run a specific stable release
384 In the repository, do
386 : $ git fetch --tags
387 : $ git tag
389 To see which release tags are available.  Let's say you decide to use
390 =release_7.01f=.
392 : $ git checkout release_7.01f
394 This set the working tree of the repository to the state of Org at the
395 moment of release 7.01f.  You can then run Org from the repository be
396 sure to use the stable release while development continues on the
397 master branch.
399 Later, when we release 7.02, you can switch to that using
401 : $ git fetch --tags                   # to get all the new stuff
402 : $ git tag
403 : $ git checkout release_7.02
405 *** Always run the most recent stable release
407 Alternatively, if you just want to always run whatever the latest
408 stable release is, you can do
410 : $ git checkout -b stable origin/maint
412 and then regularly update this branch by doing
414 : $ git pull
416 ** How can I install an up-to-date version of org-mode without "make" tools?
417    :PROPERTIES:
418    :CUSTOM_ID: installing-org-without-make-tools
419    :END:
421 If you are using org-mode on a computer that lacks developer tools for
422 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
423 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
425 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
426 you can install a recent version of org-mode without using the
427 customary =make clean && make && make install=.
429 The result of that discussion is the file/function found in
430 [[http://orgmode.org/worg/org-hacks.php#compiling-org-without-make]].
432 * Setup
433   :PROPERTIES:
434   :CUSTOM_ID: Setup
435   :END:
436 ** How can I quickly browse all Org options?
438 =M-x org-customize RET=
440 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
441 for details.
443 ** Can I use the editing features of org-mode in other modes?
444    :PROPERTIES:
445    :CUSTOM_ID: use-editing-features-in-other-modes
446    :END:
448    Not really---but there are a few editing features you can use in
449    other modes.
451    - For tables there is =orgtbl-mode= which implements the table
452      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
453    - For ordered lists there is =orgstuct-mode= which allows for easy
454      list editing as a minor mode. (To enable, type =M-x
455      orgstruct-mode=)
457    You can activate these modes automatically by using hooks:
459    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
460    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
462    For footnotes, there is the function =org-footnote-action=, which
463    works in non-org buffers. This function is a powerful tool for
464    creating and sorting footnotes. To use it globally, you can add the
465    following keybinding to your =.emacs= file (requires Org 6.17 or
466    greater):
468    : (global-set-key (kbd "C-c f") 'org-footnote-action)
470    For other features you need to switch to Org-mode temporarily, or
471    prepare text in a different buffer.
473 ** Why isn't feature "X" working the way it is described in the manual?
474    :PROPERTIES:
475    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
476    :END:
478 Org-mode develops very quickly. If you are using a version of org-mode
479 that shipped with emacs, there is a good chance that it is somewhat
480 out of date.
482 Many of the users on the org-mode mailing list are using either a
483 recent release of org-mode or the
484 [[http://orgmode.org/index.html#sec-3.2][development version of
485 org-mode from the git repository]].
487 If some settings and features aren't working the way you expect, make
488 sure that the version of the manual you are consulting matches the
489 version of org-mode you are using.
491    - You can check which version of org-mode you are using by
492      selection =Org --> Documentation --> Show Version= in the Emacs
493      menu.
495    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
496      release.
498    - The [[http://www.gnu.org/software/emacs/manual/html_node/org/index.html][manual]] at [[http://www.gnu.org][www.gnu.org]] corresponds to the version of org-mode
499      released with the latest official Gnu Emacs release. Compared
500      with the manual at the orgmode.org, the manual at www.gnu.org is
501      somewhat out of date.
503 For instructions on how to stay current with org-mode, consult
504 [[keeping-current-with-Org-mode-development][this FAQ]] or follow the
505 instructions on [[http://orgmode.org][the official org-mode site]].
507 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
508    :PROPERTIES:
509    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
510    :END:
512    Yes, these functions are written in a way that they are independent of
513    the outline setup.  The following setup provides standard Org-mode
514    functionality in outline-mode on =TAB= and =S-TAB=.  For
515    outline-minor-mode, we use =C-TAB= instead of =TAB=,
516    because =TAB= usually has mode-specific tasks.
518 #+BEGIN_SRC emacs-lisp
519 (add-hook 'outline-minor-mode-hook
520   (lambda ()
521     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
522     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
523 (add-hook 'outline-mode-hook
524   (lambda ()
525     (define-key outline-mode-map [(tab)] 'org-cycle)
526     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
527 #+END_SRC
529 Or check out /outline-magic.el/, which does this and also provides
530 promotion and demotion functionality.  /outline-magic.el/ is
531 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
533 ** Can I save/restore the visibility state of an org-mode buffer?
535 Well, no.
537 ** How can I keep track of changes in my Org files?
538    :PROPERTIES:
539    :CUSTOM_ID: track-of-changes-in-Org-files
540    :END:
542   Use git to track the history of the files, use a cronjob to check in
543   changes regularly.  Such a setup is described by Bernt Hansen
544   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
546 ** Can I use Org-mode as the default mode for all README files?
547    :PROPERTIES:
548    :CUSTOM_ID: Org-mode-as-default-mode
549    :END:
551 Add the following to your .emacs file:
553 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
555 You can even make it the default mode for any files with unspecified
556 mode using
558 : (setq default-major-mode 'org-mode)
560 ** Can I use ido.el for completing stuff in Org?
561    :PROPERTIES:
562    :CUSTOM_ID: ido-complete
563    :END:
565    Yes, you can.  If you are an ido user and ido-mode is active, the
566    following setting will make Org use =ido-completing-read= for most
567    of its completing prompts.
569 : (setq org-completion-use-ido t)
571 ** Should I use one big org file or multiple files?
572    :PROPERTIES:
573    :CUSTOM_ID: how-to-organize-org-mode-files
574    :END:
576 Org-mode is flexible enough to accomodate a variety of organizational
577 and time management schemes. Org's
578 [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline
579 cycling and convenient editing and navigation commands]] make it
580 possible to maintain all of your projects and notes in a single file.
581 But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of
582 notes and todos]], also make it a delight to maintain a private "wiki"
583 consisting of multiple files.
585 No matter how you organize your org files, org-mode's agenda commands
586 make it easy to search all your notes and gather together crucial data
587 in a single view.
589 Moreover, several org-mode settings can be configured either globally
590 in your =.emacs= file or locally (per file or per outline tree). See
591 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
592 see [[limit-agenda-with-category-match][this FAQ]].
594 Here are a few ideas for organizing org-mode files:
596 - A single file for all your projects and notes.
597 - One file per project.
598 - One file per client.
599 - One file per area of responsibility or type of work (e.g.,
600   household, health, work, etc.).
601 - One file for projects, one for appointments, one for reference
602   material, one for someday/maybe items, etc.
603 - A wiki of hyperlinked files that grows and adapts to meet your
604   needs.
606 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
607 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
609 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
610    :PROPERTIES:
611    :CUSTOM_ID: setting-global-keybindings
612    :END:
614 Org-mode has a few global keybindings that the user must set
615 explicitly in an =.emacs= file. These keybindings include the
616 customary shortcut for calling the agenda (=C-c a=). If nothing
617 happens when you type =C-c a=, then make sure that the following lines
618 are in your =.emacs= file:
620 #+BEGIN_SRC emacs-lisp
621 ;; The following lines are always needed.  Choose your own keys.
622 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
623 (global-set-key "\C-cl" 'org-store-link)
624 (global-set-key "\C-ca" 'org-agenda)
625 (global-set-key "\C-cb" 'org-iswitchb)
626 #+END_SRC emacs-lisp
628 You may, of course, choose whatever keybindings work best for you
629 and do not conflict with other modes.
631 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
632 questions.
634 ** Why aren't some of the variables I've customized having an effect?
635    :PROPERTIES:
636    :CUSTOM_ID: load-org-after-setting-variables
637    :END:
639 Some org variables have to be set before org.el is loaded or else they
640 will not work. (An example is the new variable
641 =org-enforce-todo-dependencies=.)
643 To make sure all your variables work you should not use =(require
644 'org)=. Instead use the following setting:
646 : (require 'org-install)
648 You should also make sure that you do not require any other =org-...=
649 files in your =.emacs= file before you have set your org variables,
650 since these will also cause org.el to be loaded. To be safe, load org
651 files *after* you have set your variables.
653 ** How can I make sure that timestamps appear in English?
654    :PROPERTIES:
655    :CUSTOM_ID: timestamps-and-system-time-locale
656    :END:
658 If your system's locale is not set to English, but you would like the
659 timestamps in your org-mode files to appear in English, you can set
660 the following variable:
662 #+begin_src emacs-lisp
663   (setq system-time-locale "C")
664 #+end_src
666 ** What does a minimal .emacs look like?
667 Using a stripped down minimal .emacs files removes broken custom
668 settings as the cause of an issue and makes it easy to reproduce for
669 other people.  The example below has system-specific paths that you'll
670 need to change for your own use.
671 #+begin_src emacs-lisp
672   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
673   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
674   (setq org-agenda-files '("/tmp/test.org"))
675   (require 'org-install)
676   (require 'org-habit)
677   
678   (global-set-key "\C-cl" 'org-store-link)
679   (global-set-key "\C-ca" 'org-agenda)
680   (global-set-key "\C-cb" 'org-iswitchb)
681 #+end_src
683 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
684 configuration code to it, then start emacs something like this:
685 #+begin_src sh
686   emacs -Q -l ~/minimal.emacs
687 #+end_src
689 On OS X, starting emacs with minimal configuration might look
690 something like this:
691 #+begin_src sh 
692   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
693 #+end_src sh
694 * Errors and general problems
695   :PROPERTIES:
696   :CUSTOM_ID: Errors
697   :END:
698 ** Opening Org files in Emacs leads to a crash
699    :PROPERTIES:
700    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
701    :END:
702    The only known case where Org-mode can crash Emacs is when you are
703    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
704    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
705    problem should go away.
707 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
708    :PROPERTIES:
709    :CUSTOM_ID: wrong-type-argument-keymapp
710    :END:
712    This is a conflict with an outdated version of the /allout.el/, see
713    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
715 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html.... 
716    :PROPERTIES:
717    :CUSTOM_ID: external-application-launched-to-open-file-link
718    :END:
720 If you want special control about how Org-mode opens files, see the
721 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
722 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
724 *However*, normally it is best to just use the mechanism the
725 operating-system provides:
727 *** GNU/Linux systems
728     You you have to check your mailcap settings, find the files:
730     : /etc/mailcap
731     : 
732     : or  
733     : 
734     : $HOME/.mailcap
736 and modify them accordingly. Please read their manual entry.
738 *** Windows systems 
739     + for html pages you may configure the =browse-url-= variables through
740       the Customize interface,
741     + the pdf files are automatically opened with Acrobat Reader (if it is
742       installed)
744 *** Mac OSX
745     Change the application responsible for this file type by selecting
746     such a file in the Finder, select =File->Get Info= from the menu
747     and select the application to open this file with.  Then, to
748     propagate the change to all files with the same extension, select
749     the =Change all= button.
751 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
752    :PROPERTIES:
753    :CUSTOM_ID: YASnippet
754    :END:
756 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
757 inspired by TextMate's templating syntax.
758 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
759 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
761 *Note*: yasnippet is not compatible with =org-indent-mode= currently
762 there is no known way to use both successfully with =yas/trigger-key=
763 set to =TAB= (or =[tab]= etc...)
765 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
766 =\t=) overrules yasnippets' access to this key.  The following code
767 fixes this problem:
769 #+begin_src emacs-lisp
770 (add-hook 'org-mode-hook
771           (lambda ()
772             (org-set-local 'yas/trigger-key [tab])
773             (define-key yas/keymap [tab] 'yas/next-field-group)))
774 #+end_src
776 If the above code doesn't work (which it may not with later versions
777 of yasnippet).  Then try the following
779 #+begin_src emacs-lisp
780   (defun yas/org-very-safe-expand ()
781     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
782   
783   (add-hook 'org-mode-hook
784             (lambda ()
785               ;; yasnippet (using the new org-cycle hooks)
786               (make-variable-buffer-local 'yas/trigger-key)
787               (setq yas/trigger-key [tab])
788               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
789               (define-key yas/keymap [tab] 'yas/next-field)))
790 #+end_src
792 Rick Moynihan maintains a [[http://github.com/RickMoynihan/yasnippet-org-mode][git repository]] (or [[http://github.com/eschulte/yasnippet-org-mode][Eric's fork of the same]])
793 with YASnippets for Org-mode.
795 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
796    :PROPERTIES:
797    :CUSTOM_ID: CUA-mode
798    :END:
800 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
802 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
803    :PROPERTIES:
804    :CUSTOM_ID: windmove.el
805    :END:
807 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
809 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
810    :PROPERTIES:
811    :CUSTOM_ID: loaded-old-org
812    :END:
814 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=.
816 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.
818 You should add your directories to the =load-path= at the beginning:
820 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
822 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)=.
824 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.
826 ** Why doesn't org-batch-agenda work under Win32?
827    :PROPERTIES:
828    :CUSTOM_ID: org-batch-agenda-under-win32
829    :END:
831 When I run the example batch files to print my agenda to the console
832 under Win32 I get the failure:
834 : End of file during parsing
836 and no agenda is printed.
838 The problem is the use of single quotes surrounding the eval in the
839 emacs command-line. This gets confused under Win32. All string
840 parameters with spaces must be surrounded in double quotes. This means
841 that double quotes being passed to the eval must be escaped.
843 Therefore, instead of the following:
845 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
846 :     -eval '(org-batch-agenda "a")'
848 you need to use the following:
850 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
851 :     -eval "(org-batch-agenda \"a\")"
853 (all on one line, of course).
855 ** Org agenda seems very slow
856    :PROPERTIES:
857    :CUSTOM_ID: slow-agenda
858    :END:
860 If it takes a long time to generate or refresh the agenda, you might
861 want first check which version of org-mode you are using. There have
862 been major optimizations of org-agenda since 6.21b, which was the
863 version of org-mode released with Emacs 23. If you are using 6.21b or
864 earlier (you can check with =M-x org-version=), then you might want to
865 consider upgrading to a more recent version of org-mode.
867 Here are some other ideas for speeding up the agenda:
869 1. Use a one day agenda view (rather than a seven day view).
871    =(setq org-agenda-ndays 1)=
873 2. Archive inactive items to separate files.
874    
875    =C-c C-x C-s= (org-archive-subtree)
877 3. Do not include the global todo list in your agenda view.
879    (setq org-agenda-include-all-todo nil)
881 4. Make sure that your org files are byte-compiled.
883    I.e., make sure there are files ending in .elc in your org
884    installation directory.
886 ** Visual-line-mode doesn't work well with org-mode
887    :PROPERTIES:
888    :CUSTOM_ID: visual-line-mode
889    :END:
891 Visual-line-mode "soft wraps" lines so that the visual edge of the
892 buffer is considered a line break for purposes of navigation, even
893 though there is no line break in reality. 
895 In older versions of org-mode, org-beginning-of-line and
896 org-end-of-line do not work well with visual line mode. (The two
897 commands disregard soft line breaks and move to the beginning and end
898 of the hard line break.) A patch was introduces to fix this behavior
899 in July of 2009. n
901 If you are using an older version of org mode, you can:
903 1. Add a hook to turn off visual line mode.
905 2. Add the following to your =.emacs=:
907 #+begin_src emacs-lisp
909 (add-hook 'org-mode-hook
910   (lambda ()
911     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
912     (define-key org-mode-map "\C-e" 'move-end-of-line)))
914 #+end_src
915 * Faces and highlighting
916   :PROPERTIES:
917   :CUSTOM_ID: Faces
918   :END:
919 ** Org-mode has a lot of colors?  How can I change them?
920    :PROPERTIES:
921    :CUSTOM_ID: customizing-org-faces
922    :END:
924 This is a question that applies to Emacs as a whole, but it comes up
925 quite frequently on the org-mode mailing list, so it is appropriate to
926 discuss it here.
928 If you would like to change the style of a face in org-mode (or any
929 other Emacs mode), simply type =M-x customize-face [RET]= while the
930 cursor is on the color/style you are interested in modifying. You will
931 be given the opportunity to customize all the faces located at that
932 point.
934 If you would like an overview of all the faces in org-mode, you can
935 type =C-u M-x list-faces-display [RET] org= and you will be shown all
936 the faces defined by org-mode along with an illustration of their
937 current settings.
939 If you would like to customize org-faces and other aspects of
940 org-appearance, type =M-x customize-group org-font-lock [RET]=.
942 Finally, if you would like verbose information about the properties of
943 the text under the cursor, you can type =C-u C-x ==.
945 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
946 ** Why do I get a tiny font in column view when using emacs daemon?
947    :PROPERTIES:
948    :CUSTOM_ID: column-view-tiny-font
949    :END:
951 When using emacs in daemon mode (=emacs --daemon=), client frames
952 sometimes override the column view face settings, resulting in very
953 small fonts. Here is a fix:
955 #+begin_src emacs-lisp
956   (defun org-column-view-uses-fixed-width-face ()
957   ;; copy from org-faces.el
958   (when (fboundp 'set-face-attribute)
959       ;; Make sure that a fixed-width face is used when we have a column
960       ;; table.
961       (set-face-attribute 'org-column nil
962                           :height (face-attribute 'default :height)
963                           :family (face-attribute 'default :family))))
964   
965    (when (and (fboundp 'daemonp) (daemonp))
966     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
967 #+end_src
969 This fix was provided in the following mailing list post:
971 http://article.gmane.org/gmane.emacs.orgmode/27560
972 ** How can I stop the mouse cursor from highlighting lines in the agenda?
973    :PROPERTIES:
974    :CUSTOM_ID: ratpoison-for-agenda-highlighting
975    :END:
977 You can add the following to your =.emacs=:
979 #+begin_src emacs-lisp
980 (add-hook 'org-finalize-agenda-hook
981     (lambda () (remove-text-properties
982                (point-min) (point-max) '(mouse-face t))))
983 #+end_src
985 * Outline
986   :PROPERTIES:
987   :CUSTOM_ID: Outline
988   :END:
989 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
990    :PROPERTIES:
991    :CUSTOM_ID: indirect-buffers
992    :END:
994    You may use /indirect buffers/ which do exactly this.  See the
995    documentation on the command =make-indirect-buffer=.
997    Org-mode has built-in commands that allow you create an indirect
998    buffer from a subtree of an outline. To open a subtree in new
999    window, type =C-c C-x b=. Any changes you make in the new window
1000    will be saved to the original file, but the visibility of both
1001    buffers will remain independent of one another.
1003    For multiple indirect buffers from the same file, you must use the
1004    prefix =C-u= when creating the second (or third) buffer. Otherwise
1005    the new indirect buffer will replace the old.
1007    You can also create an independent view of an outline subtree by
1008    typing =b= on an item in the agenda.
1010 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1011    :PROPERTIES:
1012    :CUSTOM_ID: Emacs-outlines-are-unreadable
1013    :END:
1015    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1016 ** C-k is killing whole subtrees!  I lost my work!
1017    :PROPERTIES:
1018    :CUSTOM_ID: C-k-is-killing-subtrees
1019    :END:
1021   =(setq org-special-ctrl-k t)= before losing your work.
1023 ** Why aren't commands working on regions?
1024    :PROPERTIES:
1025    :CUSTOM_ID: transient-mark-mode
1026    :END:
1028 Some org-mode commands, such as M-right and M-left for demoting or
1029 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1030 These commands, however, will only work on active regions set with
1031 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Transient-Mark.html#Transient-Mark][transient mark mode]]. Transient mark mode is enabled by default in
1032 Emacs 23. To enable it in earlier versions of emacs, put the following
1033 in your =.emacs= file:
1035 : (transient-mark-mode 1)
1037 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1038 momentary mark]] (=C-<SPC> C-<SPC>=).
1040 ** Why is a blank line inserted after headlines and list items?
1041    :PROPERTIES:
1042    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1043    :END:
1044    :PROPERTIES:
1045    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1046    :END:
1048 In org-mode, typing =M-RET= at the end of a headline will create a new
1049 headline of the same level on a new line. The same is true for plain
1050 lists. By default org-mode uses context to determine if a blank line
1051 should be inserted after each headline or plain list item when =M-RET=
1052 is pressed. For instance, if a there is a blank line before a
1053 headline, then typing =M-RET= at the end of the line will insert a
1054 blank line before the new headline. For instance, hitting =M-RET=
1055 at the end of "Headline Two" below inserts a new headline without a
1056 blank line:
1058 : ** Headline One
1059 : ** Headline Two
1060 : **
1062 If there is a blank line between Headline One and Headline Two,
1063 however, the results will be as follows:
1065 : ** Headline One
1067 : ** Headline Two
1069 : **
1071 If you do not like the default behavior you can change it with the
1072 variable =org-blank-before-new-entry=. You can set headings and/or
1073 plain lists to auto (the default setting), t (always), or nil (never).
1075 ** How can I promote or demote multiple headlines at once?
1076    :PROPERTIES:
1077    :CUSTOM_ID: demote-multiple-headlines
1078    :END:
1080 If you have a long list of first level headlines that you'd like to
1081 demote to second level headlines, you can select the headlines as a
1082 region and then hit =M-<right>= to demote all the headlines at once.
1084 Note: =M-S-<right>= will not work on a selected region. Its use is to
1085 demote a single subtree (i.e., a headline and all sub-headlines).
1087 If M-<right> doesn't seem to work, make sure transient mark mode is
1088 enabled. See [[transient-mark-mode][this FAQ]].
1090 ** What's the deal with all the ellipses in my org outlines?
1091    :PROPERTIES:
1092    :CUSTOM_ID: org-ellipses
1093    :END:
1095 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1096 commonly, ellispes occur at the end of headings with folded content:
1098 : * Heading ...
1100 Or, for instance, they may indicate closed drawers:
1102 : :PROPERTIES: ...
1104 Sometimes, as a result of editing and cycling an outline, ellipses may
1105 appear in unexpected places. You should *never* delete these ellipses,
1106 as you may accidentally delete hidden text. Instead, you can type =C-c
1107 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1108 may type =M-x RET show-all= to reveal all text in the org file.
1110 If you would prefer a symbol or face for indicating hidden text, you
1111 can customize the variable org-ellipses.
1113 ** How do I yank a subtree so it's indented according to points' location?
1114    :PROPERTIES:
1115    :CUSTOM_ID: yank-indent-subtree
1116    :END:
1118 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1120 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1121 yanked headline's level correctly.
1123 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1125 ** Can I read org-mode outlines in vim?
1126    :PROPERTIES:
1127    :CUSTOM_ID: org-outlines-in-vim
1128    :END:
1130 Yes, there is a script that enables one to view and navigate folded
1131 outline/org files in vim (though without most of org-mode's
1132 functionality, of course).
1134   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1136 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1137 post]].
1139 * Todos and Tags
1140   :PROPERTIES:
1141   :CUSTOM_ID: Todos-and-Tags
1142   :END:
1143 ** How can I cycle through the TODO keyword of an entry?
1144    :PROPERTIES:
1145    :CUSTOM_ID: cycle-TODO-keywords
1146    :END:
1148   =C-c C-t= or =S-<left/right>= is what you need.
1150 ** How do I track state changes for tasks in Org?
1151    :PROPERTIES:
1152    :CUSTOM_ID: track-state-changes-for-tasks
1153    :END:
1155   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1156   states and logging timestamps for task state changes.
1158 ** Can I select the TODO keywords with a tag-like interface?
1159    :PROPERTIES:
1160    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1161    :END:
1163   Yes.  Use =(setq org-use-fast-todo-selection t)=
1165   If you want to set both your todos and your tags using a single
1166   interface, then check out the variable
1167   =org-fast-tag-selection-include-todo=.
1169   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1171 ** How can I quickly set the tag of an entry?
1172    :PROPERTIES:
1173    :CUSTOM_ID: quickly-set-tag-of-entry
1174    :END:
1176    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1177    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1178    keybinding for filing a note from the remember buffer.
1180    You can set tags even more quickly by setting one of the character
1181    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1183    To set tag shortcuts for all org buffers, put something like the
1184    following in your =.emacs= file (or create the same settings by
1185    typing =M-x customize-variable RET org-tag-alist=):
1187 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1189    To set tag shortcuts for a single buffer, put something like the
1190    following at the top of your org file:
1192 : #+TAGS: computer(c) office(o) home(h)
1194 ** How can I change the colors of TODO keywords?
1196 You can use the variable org-todo-keyword-faces. Here are some sample
1197 settings:
1199 #+begin_src emacs-lisp
1200 (setq org-todo-keyword-faces
1201       '(
1202         ("TODO"  . (:foreground "firebrick2" :weight bold))
1203         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1204         ("LATER"  . (:foreground "sienna" :weight bold))
1205         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1206         ("DONE"  . (:foreground "forestgreen" :weight bold))
1207         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1208         ("CANCELED"  . shadow)
1209         ))
1210 #+end_src
1212 If you want to change the color of all active todos or all inactive
1213 todos, type:
1215 : M-x customize-face RET org-todo
1216 : M-x customize-face RET org-done
1218 You can also set values for each of these in your =.emacs= file:
1220 : (set-face-foreground 'org-todo "firebrick2")
1221 : (set-face-foreground 'org-done "forestgreen")
1223 * Hyperlinks
1224   :PROPERTIES:
1225   :CUSTOM_ID: Hyperlinks
1226   :END:
1227 ** Why do I have to confirm the execution of each shell/elisp link?
1228    :PROPERTIES:
1229    :CUSTOM_ID: confirm-shell/elisp-link
1230    :END:
1232    The confirmation is there to protect you from unwantingly execute
1233    potentially dangerous commands.  For example, imagine a link
1235    : [[shell:rm -rf ~/*][Google Search]]
1237    In an Org-mode buffer, this command would look like /Google Search/,
1238    but really it would remove your home directory.  If you wish, you can
1239    make it easier to respond to the query by setting
1241    : (setq org-confirm-shell-link-function 'y-or-n-p
1242    :       org-confirm-elisp-link-function 'y-or-n-p).
1244    Then a single keypress will be enough to confirm those links.  It is
1245    also possible to turn off this check entirely, but I strongly
1246    recommend against this.  Be warned.
1248 ** Can I use RET or TAB to follow a link?
1249    :PROPERTIES:
1250    :CUSTOM_ID: RET-or-TAB-to-follow-link
1251    :END:
1253    Yes, this is how:
1255    : (setq org-return-follows-link t)
1256    : (setq org-tab-follows-link t)
1258 ** Can I keep mouse-1 clicks from following a link?
1259    :PROPERTIES:
1260    :CUSTOM_ID: mouse-1-following-link
1261    :END:
1263    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1264    link behavior similar to other applications like web browsers.  If
1265    you hold the mouse button down a bit longer, the cursor will be set
1266    without following the link.  If you cannot get used to this behavior,
1267    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1268    link activation for =mouse-1= with
1270    : (setq org-mouse-1-follows-link nil)
1272 ** How can I get completion of file names when creating a link?
1273    :PROPERTIES:
1274    :CUSTOM_ID: completion-of-file-links
1275    :END:
1277 You can use org-insert-link with a prefix argument:
1279 : C-u C-c C-l
1281 You will be greeted with prompt in the minibuffer that allows for file
1282 completion using your preferred Emacs method for finding files.
1284 * Plain Lists
1285   :PROPERTIES:
1286   :CUSTOM_ID: Plain-Lists
1287   :END:
1288 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1289    :PROPERTIES:
1290    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1291    :END:
1293 : (setq org-blank-before-new-entry
1294 :       '((heading . t) (plain-list-item . nil))
1296 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1298 ** How can I convert itemized lists to enumerated lists?
1299    :PROPERTIES:
1300    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1301    :END:
1303    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1304    bullet headlines available for lists: =-, +, *, 1., 1)=.
1306    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1308 ** How can I convert plain lists to headlines and vice versa?
1309    :PROPERTIES:
1310    :CUSTOM_ID: convert-plain-lists-to-headlines
1311    :END:
1313    To convert a plain list item or line to a headline, type =C-c *= on
1314    the headline. This will make the line a subheading of the current
1315    headline.
1317    To convert a headline to a plain list item, type =C-c -= while the
1318    cursor is on the headline.
1320    To convert a headline to an unadorned line of text, type =C-c *= on
1321    the headline.
1323    You can use query replace to accomplish the same things, as Bernt
1324    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1326 ** Is there a good way to create a description list?
1327    :PROPERTIES:
1328    :CUSTOM_ID: description-lists
1329    :END:
1331   Yes, these are now built-in:
1333 #+BEGIN_EXAMPLE
1334 - item1 :: Description of this item 1
1335 - item2 :: Description of this item 2
1336 - item1 :: Description of this item 3
1337       also in multiple lines
1338 #+END_EXAMPLE
1340 * Tables
1341   :PROPERTIES:
1342   :CUSTOM_ID: Tables
1343   :END:
1344 ** Can I plot data from a table?
1345    :PROPERTIES:
1346    :CUSTOM_ID: plotting-table-data
1347    :END:
1349    Yes, you can, using org-plot.el written by James TD Smith and now
1350    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1352    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1354 ** How can I fill a table column with incremental numbers?
1355    :PROPERTIES:
1356    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1357    :END:
1359 Here is how: Use a field formula to set the first value in the column:
1361 #+begin_src org
1362 ,| N   |   |
1363 ,|-----+---|
1364 ,| :=1 |   |
1365 ,|     |   |
1366 ,|     |   |
1367 ,|     |   |
1368 ,#+TBLFM: @2$1=1
1369 #+end_src
1371 Then define a column formula in the second field:
1373 #+begin_src org
1374 ,| N        |   |
1375 ,|----------+---|
1376 ,| 1        |   |
1377 ,| =@-1 + 1 |   |
1378 ,|          |   |
1379 ,|          |   |
1380 ,#+TBLFM: @2$1=1
1381 #+end_src
1383 After recomputing the table, the column will be filled with
1384 incremental numbers:
1386 #+begin_src org
1387 ,| N |   |
1388 ,|---+---|
1389 ,| 1 |   |
1390 ,| 2 |   |
1391 ,| 3 |   |
1392 ,| 4 |   |
1393 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1394 #+end_src
1396 Note that you could use arbitrary starting values and column formulas.
1398 ** Why does my table column get filled with #ERROR?
1399    :PROPERTIES:
1400    :CUSTOM_ID: table-column-filled-with-ERROR
1401    :END:
1403    Org-mode tried to compute the column from other fields using a
1404    formula stored in the =#+TBLFM:= line just below the table, and
1405    the evaluation of the formula fails.  Fix the fields used in the
1406    formula, or fix the formula, or remove it!
1408 ** How can I stop the table editor from creating new lines?
1409    :PROPERTIES:
1410    :CUSTOM_ID: table-editor-creates-new-lines
1411    :END:
1413    When I am in the last column of a table and just above a horizontal
1414    line in the table, pressing TAB creates a new table line before the
1415    horizontal line.  To move to the line below the
1416    horizontal line instead, do this:
1418    Press =down= (to get on the separator line) and then =TAB=.
1419    Or configure the variable
1421    : (setq org-table-tab-jumps-over-hlines t)
1423 ** How can I get table fields starting with "="?
1424    :PROPERTIES:
1425    :CUSTOM_ID: table-fields-starting-with-=
1426    :END:
1428    With the setting
1430    : (setq org-table-formula-evaluate-inline nil)
1432    this will no longer happen.  You can still use formulas using the
1433    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1435 ** How can I change the indentation of an entire table without fixing every line by hand?
1436    :PROPERTIES:
1437    :CUSTOM_ID: change-indentation-entire-table
1438    :END:
1440    The indentation of a table is set by the first line.  So just fix the
1441    indentation of the first line and realign with =TAB=.
1443 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1444    :PROPERTIES:
1445    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1446    :END:
1448    Either split the table into several by inserting an empty line every
1449    100 lines or so.  Or turn off the automatic re-align with
1451    : (setq org-table-automatic-realign nil)
1453    After this the only way to realign a table is to press =C-c C-c=.  It
1454    will no longer happen automatically, removing the corresponding delays
1455    during editing.
1457 ** Recalculation of my table takes too long.  What can I do?
1458    :PROPERTIES:
1459    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1460    :END:
1462    Nothing, really.  The spreadsheet in org is mostly done to make
1463    calculations possible, not so much to make them fast.  Since Org-mode
1464    is firmly committed to the ASCII format, nothing is stopping you from
1465    editing the table by hand.  Therefore, there is no internal
1466    representation of the data.  Each time Org-mode starts a computation,
1467    it must scan the table for special lines, find the fields etc.  This
1468    is slow.  Furthermore, Calc is slow compared to hardware
1469    computations.  To make this work with normal editing, recalculation
1470    is not happening automatically, or only for the current line, so that
1471    the long wait for a full table iteration only happens when you ask
1472    for it.
1474    So for really complex tables, moving to a "real" spreadsheet may
1475    still be the best option.
1477    That said, there are some ways to optimize things in Org-mode, and I
1478    have been thinking about moving a bit further down this line.
1479    However, for my applications this has so far not been an issue at
1480    all.  If you have a good case, you could try to convince me.
1482 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1483    :PROPERTIES:
1484    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1485    :END:
1487    Well, it is /supposed/ to be a feature, to make it easy to create a
1488    column with increasing numbers.  If this gets into your way, turn it
1489    off with
1491    : (setq org-org-table-copy-increment nil)
1493 ** When I export tables to html, they don't have borders.
1494    :PROPERTIES:
1495    :CUSTOM_ID: table-borders-in-html-export
1496    :END:
1498 By default, org mode exports tables without borders.
1500 You can changed this by placing an =#+ATTR_HTML= line before the
1501 table:
1503 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1505 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1507 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1508    :PROPERTIES:
1509    :CUSTOM_ID: table-high-precision
1510    :END:
1512 - *Short answer*
1514   Avoid
1515   : | 0.16666667000000 |
1516   : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1517   and use
1518   : | 0.16666666666667 |
1519   : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1521 - *Longer answer*
1523   It is important to distinguish between the precision of
1524   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1525   2) =f14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1526   3) =%.14f=: the =printf= reformatting, limited in precision
1528   See [[http://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calc][the Org manual]] (org-version 6.35 or newer) for more details.
1530   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1531   which are used if no format specifiers are added to a table formula.
1532   The examples below have been made with the out_of_the_box Org defaults
1533   =calc-internal-prec = 12= and =calc-float-format = 8=.
1535   Remember the formula debugger, toggled with =C-c {=,
1536   to view the processing stages like:
1537   |   | formula debugger label | processing stage           |
1538   | / | <                      | <>                         |
1539   |---+------------------------+----------------------------|
1540   |   | Result:                | output of Calc             |
1541   |   | Format:                | reformatting with =printf= |
1543   Following are some examples to demonstrate
1544   the interaction of the three precisions.
1546   - *display precision limitations for Calc formulas*
1547     - limited by Calc internal calculation precision from Org default
1548       (here =p12=)
1549       : | 0.16666666666700 |
1550       : #+TBLFM: $1 = 1 / 2 * 3;     f14
1552       : | 0.1666666666670000000 |
1553       : #+TBLFM: $1 = 1 / 2 * 3;     f19
1555     - limited by Calc float format from Org default (here =f8=)
1556       : | 0.16666667 |
1557       : #+TBLFM: $1 = 1 / 2 * 3
1559       : | 0.16666667 |
1560       : #+TBLFM: $1 = 1 / 2 * 3; p20
1562       : | 0.16666667000000 |
1563       : #+TBLFM: $1 = 1 / 2 * 3;         %.14f
1565       : | 0.16666667000000 |
1566       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.14f
1568     - limited by Calc float format specified
1569       : | 0.166667 |
1570       : #+TBLFM: $1 = 1 / 2 * 3;     f6
1572       : | 0.16666666666667 |
1573       : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1575       : | 0.1666666666666666667 |
1576       : #+TBLFM: $1 = 1 / 2 * 3; p20 f19
1578     - limited by =printf= conversion to Emacs Lisp float
1579       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1580       : #+TBLFM: $1 = 1 / 2 * 3;         %.19f
1582       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1583       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.19f
1585       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1586       : #+TBLFM: $1 = 1 / 2 * 3; p20 f20 %.19f
1588     - limited by =printf= format specified
1589       : | 0.166667 |
1590       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1592   - *display precision limitations for Emacs Lisp formulas*
1593     - limited by Emacs Lisp float
1594       : | 0.16666666666666666 |
1595       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1597       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1598       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1600     - limited by =printf= format specified
1601       : | 0.16666666666667 |
1602       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1604 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1605 and is continued in the [[#table-float-fraction][next FAQ entry]].
1607 ** Which float format shows the fraction part also when the latter is zero?
1608    :PROPERTIES:
1609    :CUSTOM_ID: table-float-fraction
1610    :END:
1612 - *Short answer*
1614   Avoid
1615   : | 1 |
1616   : #+TBLFM: $1 = 1 + 0; f3
1617   and use
1618   : | 1.000 |
1619   : #+TBLFM: $1 = 1 + 0; %.3f
1621 - *Longer answer*
1623   For =f3= and =f-3= see =`d f' (`calc-fix-notation')= in [[http://www.delorie.com/gnu/docs/calc/calc.html#SEC_Top][the Calc manual]]
1624   in the section Mode Settings -> Display Modes -> Float Formats
1625   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is kept]].
1627   Remember the formula debugger, toggled with =C-c {=,
1628   to view the processing stages like:
1629   |   | formula debugger label | processing stage           |
1630   | / | <                      | <>                         |
1631   |---+------------------------+----------------------------|
1632   |   | Result:                | output of Calc             |
1633   |   | Format:                | reformatting with =printf= |
1635   Following are some examples to demonstrate different float formats.
1637   - normal precision
1638     : |----------------------+---------+-------+-------|
1639     : | number               |      f3 |   f-3 |  %.3f |
1640     : |----------------------+---------+-------+-------|
1641     : | 1 + 0                |       1 |     1 | 1.000 |
1642     : | 0 + 0                |       0 |     0 | 0.000 |
1643     : |----------------------+---------+-------+-------|
1644     : | 1 + 1 / 2 * 3 * 1000 |   1.000 | 1.000 | 1.000 |
1645     : | 0 + 1 / 2 * 3 * 1000 | 1.67e-4 | 0.000 | 0.000 |
1646     : |----------------------+---------+-------+-------|
1647     : | 1 + 1 / 2 * 3 *  100 |   1.002 | 1.002 | 1.002 |
1648     : | 0 + 1 / 2 * 3 *  100 |   0.002 | 0.002 | 0.002 |
1649     : |----------------------+---------+-------+-------|
1650     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1; %.3f
1652   - high precision
1653     : |----------------------+--------------------------+-----------------------|
1654     : | number               |                      f19 |                  f-19 |
1655     : |----------------------+--------------------------+-----------------------|
1656     : | 1 + 0                |                        1 |                     1 |
1657     : | 0 + 0                |                        0 |                     0 |
1658     : |----------------------+--------------------------+-----------------------|
1659     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1660     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1661     : |----------------------+--------------------------+-----------------------|
1662     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1663     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1664     : |----------------------+--------------------------+-----------------------|
1665     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1667     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1668     see the [[#table-high-precision][previous FAQ entry]].
1670 * Markup
1671   :PROPERTIES:
1672   :CUSTOM_ID: Footnotes
1673   :END:
1674 ** How can I get automatic renumbering of footnotes in org-mode?
1675    :PROPERTIES:
1676    :CUSTOM_ID:       footnote-auto-adjust
1677    :END:
1679 You can add the following line to your .emacs file:
1681 : (setq org-footnote-auto-adjust t)
1683 Or, if you prefer, you can turn this option on locally by placing the
1684 following line at the top of your org file:
1686 : #+STARTUP: fnadjust
1688 When auto-adjust is turned on, footnotes in the file with numerical
1689 labels will be renumbered whenever a new footnote is added. Meanwhile,
1690 all footnotes, including those with custom labels such
1691 =[fn:custom-label ]=, will be sorted in the order of their appearance
1692 in the text.
1694 This emulates the footnote behavior that many users may be familiar
1695 with from word-processing programs or from the footnote-mode included
1696 with emacs.
1698 If you do not turn on org-footnote-auto-adjust, you sort and/or
1699 renumber footnotes at any time by calling org-footnote-action with a
1700 prefix argument.
1702 ** Why isn't auto renumbering of footnotes turned on by default?
1703    :PROPERTIES:
1704    :CUSTOM_ID:       why-no-default-auto-adjust
1705    :END:
1707 Org mode has a very robust footnote mechanism allowing for a variety
1708 of types of footnotes. With some of the following footnote notations,
1709 auto-adjust may be either irrelevant or undesired:
1711  - Automatically numbered
1712  - Footnotes with custom labels
1713  - Inline footnotes
1715 In addition, org mode can be customized to place footnotes either at
1716 the end of a document or at the end of the outline heading in which
1717 they appear. Users who change this setting while editing a document
1718 may be disconcerted to find all of their footnotes rearranged
1719 automatically.
1721 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1722    :PROPERTIES:
1723    :CUSTOM_ID: auto-fill-and-unwanted-comments
1724    :END:
1726 If the following occurs:
1728 #+begin_src org
1730 #+OPTIONS: toc:nil
1731 Some entered text.
1732 # More entered tex.
1734 #+end_src
1736 Make sure that the variable comment-start is nil.
1738 ** Are there any shortcuts for entering source blocks and comment lines?
1739    :PROPERTIES:
1740    :CUSTOM_ID: shortcuts-for-entering-source-blocks
1741    :END:
1743 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
1744 and lines of code in a file. (This is especially useful when exporting
1745 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
1746 blocks of code.)
1748 #+begin_src org
1749   ,#+begin_src perl
1750   ,  print "Hello, world!\n";
1751   ,#+end_src
1752 #+end_src
1754 It can be tiresome to enter the block comment lines manually. There
1755 are several possible shortcuts you can use to enter them:
1757 1) Built-in expansion
1759    - Org mode has a "secret" method of expanding source code blocks
1760      and comment lines.
1762    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
1763      magically appear.
1765    - For a full list of expansions, type =M-x describe-variable
1766      [RET] org-structure-template-alist=.
1768 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
1770    - Add the following line to your emacs file:
1772      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
1774    - Then type =C-x r i p= to insert the source block. Please note: if
1775      you save another value to the register "p" with =C-x r s p=, it
1776      will overwrite the setting above for the current emacs session.
1778 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
1780  - Activate the abbrev minor-mode in org-mode:
1782    + M-x abbrev-mode
1784    + /Permanently/:
1786        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
1788  - In org-mode, type "sbp" (a sample abbreviation for a perl source
1789    block).
1791  - Immediately after "sbp" type =C-x a i l=.
1793  - Enter the expansion: 
1795    - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
1797    - Note: =C-q C-j= creates a new line in the minibuffer
1799  - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
1800    org-mode buffer, the src block will magically appear.
1802  - To review your list of abbrevs, type =M-x edit-abbrevs=.
1804  - If you want more complex completion (like yasnippet) you can combine
1805    abbrev mode with [[http://www.emacswiki.org/emacs/SkeletonMode][skeletons]].
1807 4) [[http://code.google.com/p/yasnippet/][Yasnippet]]
1809  - Several org-mode users install yasnippet for convenient, complex
1810    expansion.
1812  - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
1813    yasnippet.
1815 * Remember
1816   :PROPERTIES:
1817   :CUSTOM_ID: Remember
1818   :END:
1819 ** Can I use the remember buffer to clock a customer phone call?
1820    :PROPERTIES:
1821    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
1822    :END:
1824   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
1825   and check out (in the same thread) what Nick Docos had to fix to
1826   make Bernt's set-up work for him.
1827 ** Can I automatically start the clock when opening a remember template?
1828    :PROPERTIES:
1829    :CUSTOM_ID: start-clock-when-opening-remember-template
1830    :END:
1832    Yes, this is possible.  Use the following code and make sure that
1833    after executing it, `my-start-clock-if-needed' is in
1834    `remember-mode-hook' /after/ `org-remember-apply-template'.
1836    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
1837    : (defun my-start-clock-if-needed ()
1838    :   (save-excursion
1839    :     (goto-char (point-min))
1840    :     (when (re-search-forward " *CLOCK-IN *" nil t)
1841    :       (replace-match "")
1842    :       (org-clock-in))))
1844    Then, when a template contains the key string CLOCK-IN, the clock
1845    will be started.  Starting with Org-mode version 5.20, the clock will
1846    automatically be stopped when storing the remember buffer.
1848 * Searches
1849   :PROPERTIES:
1850   :CUSTOM_ID: Searches
1851   :END:
1852 ** Isearch does not find string hidden in links.  What can I do?
1853    :PROPERTIES:
1854    :CUSTOM_ID: isearch-in-links
1855    :END:
1857   M-x =visible-mode= will display the full link, making them searchable.
1859 ** How can I reduce the amount of context shown in sparse trees?
1860    :PROPERTIES:
1861    :CUSTOM_ID: context-in-sparse-trees
1862    :END:
1864    Take a look at the following variables:
1866    - =org-show-hierarchy-above=
1867    - =org-show-following-headline=
1868    - =org-show-siblings=
1869    - =org-show-entry-blow=
1871    which give command-dependent control over how much context is shown
1872    by a particular operation.
1874 ** How can I combine the results of two calls to =org-occur=?
1875    :PROPERTIES:
1876    :CUSTOM_ID: two-calls-to-org-occur
1877    :END:
1879    You can construct a regular expression that matches all targets you
1880    want.  Alternatively, use a =C-u= prefix with the second and any
1881    further calls to =org-occur= to keep the current visibility and
1882    highlighting in addition to the new ones.
1884 * Agenda
1885   :PROPERTIES:
1886   :CUSTOM_ID: Agenda
1887   :END:
1888 ** How can I change the advanced warning time for deadlines?
1889 ##<<warning-period-for-deadlines>>
1891 Deadline warnings appear in the daily agenda view a specified number
1892 of days before the deadline is due. The default setting is 14 days.
1893 You can change this with the variable =org-deadline-warning-days=.
1894 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
1896 For instance,
1898 : (setq org-deadline-warning-days 30)
1900 would cause warnings for each deadline to appear 30 days in advance.
1902 Naturally, you might not want warnings for all of your deadlines to
1903 appear so far in advance. Thus, you can change the lead time for
1904 individual items as follows:
1906 : * TODO Get a gift for the party
1907 :   DEADLINE: <2009-01-16 Fri -2d>
1909 The "-2d" above changes the lead time for this deadline warning to two
1910 days in advance. You can also use "w" for weeks and "m" for months.
1911 ** How can I postpone a task until a certain date?
1912    :PROPERTIES:
1913    :CUSTOM_ID: deferring-tasks
1914    :END:
1916 The easiest way to postpone a task is to schedule it in the future.
1917 For instance, typing =C-c C-s +2w= on a headline will push a task two
1918 weeks into the future, so that it won't show up on the daily agenda
1919 until two weeks from now.
1921 If you'd like to prevent the task from showing up on your global todo
1922 list, you have a couple of options.
1924 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
1925    This will exclude any scheduled items from your global list of
1926    active todos (=C-c a t=). (The variable
1927    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
1928    deadline items from your todo list).
1929 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
1930    item will still appear on your agenda two weeks from today, but it
1931    won't show up on your todo lists.
1932 ** Can I send myself an email containing tasks or other agenda info?
1933    :PROPERTIES:
1934    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
1935    :END:
1937    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
1939 ** How can I limit the agenda view to my "work" tasks?
1940    :PROPERTIES:
1941    :CUSTOM_ID: limit-agenda-with-tag-filtering
1942    :END:
1944    It is often convenient to group org files into separate categories,
1945    such as "home" and "work" (or "personal" and "professional"). One
1946    of the main reasons for such classification is to create agenda
1947    views that are limited by type of work or area of responsibility.
1948    For instance, while at work, one may want to see only professional
1949    tasks; while away from work, one may want to see only personal
1950    tasks.
1952    One way to categorize files and tasks is to use a "#+FILETAGS"
1953    declaration at the top of each file, such as:
1955    : #+FILETAGS: work
1957    As long as org-use-tag-inheritance is turned on, the filetags will
1958    be inherited by all tasks in the file. A file can have multiple
1959    filetags. And, of course, tags can be added to individual headings.
1961    Tasks can be quickly filtered by tag from within the agenda by
1962    typing "/" and the name of the tag. The full key sequence to filter
1963    for work items in an agenda view would be:
1965    : C-c a a / work [or a tag shortcut]
1967 ** How can I limit the agenda view to a particular category?
1968    :PROPERTIES:
1969    :CUSTOM_ID: limit-agenda-with-category-match
1970    :END:
1972    Another way to filter agenda views by type of work is to use a
1973    "#+CATEGORY" declaration at the top of each file, such as:
1975    : #+CATEGORY: work
1977    Categories can also be added to individual headings within a file:
1979    : * Big project
1980    :   :PROPERTIES:
1981    :   :CATEGORY: work
1982    :   :END:
1984    All todos belonging to the category "work" can be found a with a
1985    simple tags-todo search:
1987    : C-c a M
1989    At the prompt, type:
1991    : CATEGORY="work"
1993    The same results can be achieved with custom agenda commands, such as:
1995 #+BEGIN_SRC emacs-lisp
1996 (setq org-agenda-custom-commands
1997       '(("h" tags-todo "CATEGORY=\"home\"")
1998         ("w" tags-todo "CATEGORY=\"work\"")
1999         ;; other custom agenda commands here
2000         ))
2001 #+END_SRC
2003 ** How can include all org files in a directory in my agenda?
2004    :PROPERTIES:
2005    :CUSTOM_ID: set-agenda-files-using-wildcards
2006    :END:
2008 You can simply include the directory (as one of the items) in the
2009 value of the variable org-agenda-files:
2011 : (setq org-agenda-files '("/my/special/path/org/"))
2013 There is another way of accomplishing the same end:
2015 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2017 ** Why aren't items disappearing from my agenda once they are marked done?
2018    :PROPERTIES:
2019    :CUSTOM_ID: removing-done-items-from-agenda
2020    :END:
2022 If items remain on your daily/weekly agenda after they are marked
2023 done, check the configuration of the following variables:
2025 : org-agenda-skip-scheduled-if-done
2026 : org-agenda-skip-deadline-if-done
2027 : org-agenda-skip-timestamp-if-done
2029 For instance, type:
2031 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2033 If this variable is turned off (=nil=), then scheduled items will
2034 remain on the agenda even after they are marked done.
2036 If the variable is turned on (=t=), then scheduled items will
2037 disappear from the agenda after they are marked done.
2039 If these settings seem not to behave the way you expect, then make
2040 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2041 difference between SCHEDULED, DEADLINE, and timestamps]].
2043 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2044    :PROPERTIES:
2045    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2046    :END:
2048 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2049    the day they are scheduled and on every day thereafter until they
2050    are done. Schedule a task if you want to be reminded to do
2051    something beginning on a certain day and until it is done.
2053 : ** TODO Scheduled item
2054 :    SCHEDULED: <2009-03-01 Sun>
2056 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2057    agenda in advance of the when they are due and remain on your
2058    agenda until they are done. Add a DEADLINE to an item if you want
2059    to make sure to complete it by a certain date. (The variable
2060    org-deadline-warning-days determines how far in advance items with
2061    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2062    information.)
2064 : ** TODO Item with a deadline
2065 :    DEADLINE: <2009-01-20 Tue>
2067 3. An active timestamp (set with =C-c .=) will appear on your agenda
2068    only on the day it is scheduled. Use a timestamp for appointments
2069    or any reminders you want to show up only on a particular day.
2071 : ** TODO Item with an active timestamp
2072 : <2009-04-18 Sat>
2074 Note: items with inactive timestamps (set with C-c ! and marked by
2075 square brackets) will not show up in the agenda at all.
2077 ** Can I add files recursively to my list of agenda files?
2078    :PROPERTIES:
2079    :CUSTOM_ID: set-agenda-files-recursively
2080    :END:
2082 Yes, you can use the library "find-lisp."
2084 : (load-library "find-lisp")
2085 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2087 This will add all files ending in =org= in the directory "~/org"
2088 and all of its subdirectories to your list of agenda files.
2090 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2092 ** Why does an item appearing at the wrong time of day in my agenda?
2093    :PROPERTIES:
2094    :CUSTOM_ID: agenda-wrong-time-of-day
2095    :END:
2097 When preparing the agenda view, org-mode scans each relevant headline
2098 for a time designation. This approach is very nice for adding
2099 free-form timestamps to an item for scheduling. Thus, either of the
2100 following work would work to schedule an item at 10:00am:
2102 #+begin_src org
2103 ,** 10:00am Get dried ice at the magic store
2104 ,   SCHEDULED: <2009-05-27 Wed>
2105 #+end_src
2107 #+begin_src org
2108 ,** Get dried ice at the magic store
2109 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2110 #+end_src
2112 To enable this flexibility, org-mode scans the entire headline for
2113 time of day notation. A potential problem can arise if you use
2114 inactive timestamps in the headline to note when an item was created.
2115 For example,
2117 #+begin_src org
2118 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2119 ,   SCHEDULED: <2009-05-27 Wed>
2120 #+end_src
2122 Org mode would interpret the time in the inactive timestamp as a
2123 time-of-day indicator and the entry would appear in your agenda at
2124 12:58.
2126 If you would like to turn off the time-of-day search, you can
2127 configure the variable =org-agenda-search-headline-for-time= (requires
2128 org-mode >= 6.24).
2130 ** How can I change the visibility of an item from the agenda?
2131    :PROPERTIES:
2132    :CUSTOM_ID: cycling-visibility-from-agenda
2133    :END:
2135 You can add a keybinding as follows:
2137 #+begin_src emacs-lisp
2138 (add-hook 'org-agenda-mode-hook
2139    (lambda ()
2140      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2141 #+end_src
2143 Then, as you press SPACE on an item on the agenda, it will cycle the
2144 visibility of its original location.
2146 * Appointments/Diary
2147   :PROPERTIES:
2148   :CUSTOM_ID: Appointments/Diary
2149   :END:
2150 ** Is it possible to include entries from org-mode files into my emacs diary?
2151    :PROPERTIES:
2152    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2153    :END:
2155    Since the org-mode agenda is much more powerful and can contain the
2156    diary, you should think twice before deciding to do this.  If you
2157    insist, however, integrating Org-mode information into the diary is
2158    possible.  You need to turn on /fancy diary display/ by setting in
2159    .emacs:
2161    : (add-hook 'diary-display-hook 'diary-fancy-display)
2163    Then include the following line into your ~/diary file, in
2164    order to get the entries from all files listed in the variable
2165    =org-agenda-files=
2167    : &%%(org-diary)
2169    You may also select specific files with
2171    : &%%(org-diary) ~/path/to/some/org-file.org
2172    : &%%(org-diary) ~/path/to/another/org-file.org
2174    If you now launch the calendar and press @<tt>d@</tt> to display a
2175    diary, the headlines of entries containing a timestamp, date range,
2176    schedule, or deadline referring to the selected date will be listed.
2177    Just like Org-mode's agenda view, the diary for /today/ contains
2178    additional entries for overdue deadlines and scheduled items.  See
2179    also the documentation of the =org-diary= function.  Under XEmacs, it
2180    is not possible to jump back from the diary to the org, this works
2181    only in the agenda buffer.
2182 ** I want to add my Org scheduled/deadlined entries in my diary!
2183    :PROPERTIES:
2184    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2185    :END:
2187   Put this in your ~/.diary:
2189   : &%%(org-diary :scheduled :timestamp :deadline)
2191 ** How can I set up automatic reminders based on Org information?
2192    :PROPERTIES:
2193    :CUSTOM_ID: automatic-reminders
2194    :END:
2196   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2197 ** How can I make =appt= notice my Org appointments?
2198    :PROPERTIES:
2199    :CUSTOM_ID: appt-notice-my-Org-appointments
2200    :END:
2202   : M-x org-agenda-to-appt RET
2204 ** How can I create more complex appointments in my org-files?
2205    :PROPERTIES:
2206    :CUSTOM_ID: diary-sexp-in-org-files
2207    :END:
2209 Org-mode's active timestamps work very well for scheduling individual
2210 or recurring appointments, such as:
2212 #+begin_src org
2213   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2214 #+end_src
2217 #+begin_src org
2218   ,* Vacation
2219   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2220 #+end_src
2224 #+begin_src org
2225   ,* Weekly meeting with boss
2226   ,  <2009-01-20 Tue 14:00 +1w>
2227 #+end_src
2229 Sometimes, however, you need to set up more complicated recurring
2230 appointments. Org-mode has built-in support for many of
2231 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2232 powerful sexp entries]] that work in [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Diary.html#Diary][Emacs diary]]. Let's say, for
2233 instance, that you teach a class that meets every Monday evening
2234 between February 16 and April 20, 2009. The way to enter this an
2235 org-mode file is:
2237 #+begin_src org
2238   ,** Class 7:00pm-9:00pm
2239   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2240 #+end_src
2242 The expression above designates all Mondays that fall between February
2243 16 and April 20. How exactly does it work?
2245  - (and... :: Indicates that *both* of the conditions that follow have
2246           to be true.
2248    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2249         Monday?
2251        - Note: the function calendar-day-of-week converts the date to the day of week
2252          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2254    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2255         these two dates?
2257 You can make a sexp as complex as you like. If you wanted to omit a
2258 week because of holidays, for instance, you could add another
2259 condition to the sexp:
2261 #+begin_src org
2262   ,** Class 7:00pm-9:00pm
2263   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2264 #+end_src
2266 The sexp above would omit Monday during the week of March 9, 2009. For
2267 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2269 Another diary function commonly used for more complex scheduling is
2270 diary-float. For instance,
2272 #+begin_src org
2273   ,* Monthly meeting
2274   ,  <%%(diary-float t 3 3)>
2275 #+end_src
2277 ...would appear on the third Wednesday of every month.
2279 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2280 page on the Emacs wiki]].
2282 ** How can I schedule a weekly class that lasts for a limited period of time?
2283    :PROPERTIES:
2284    :CUSTOM_ID: org-diary-class
2285    :END:
2287 Org-mode offers a convenient diary sexp function for setting up a
2288 recurring appointment that lasts for a certain period of time, such as
2289 a class. It is called org-diary-class and it can be entered as
2290 follows:
2292 #+begin_src org
2293   ,** Class 7:00pm-9:00pm
2294   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2295 #+end_src
2297 The function above schedules an appointment for every Monday (1)
2298 between February 16 and April 20, 2009, except for ISO week 10 (March
2299 1 to March 7).
2301 The function org-diary-class has the following format:
2303 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2305 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2306 takes the form of a number indicating the day of the week (0 = Sunday,
2307 1 = Monday, and so on...). In addition, one can add an optional
2308 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2309 skipped. This argument should be expressed as an ISO week number. You
2310 can find the number by invoking emacs' built-in calendar (=M-x
2311 calendar=), navigating to the appropriate week, and typing =p c=
2312 (calendar-iso-print-date).
2314 ** How can I set an event to occur every day except Saturday and Sunday?
2316    #+begin_example
2317    ** Daily meeting
2318       <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2319    #+end_example
2321 * Export
2322   :PROPERTIES:
2323   :CUSTOM_ID: Export
2324   :END:
2325 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2326    :PROPERTIES:
2327    :CUSTOM_ID: export-TODO-items-as-lists
2328    :END:
2330    If you plan to use ASCII or HTML export, make sure things you want to
2331    be exported as item lists are level 4 at least, even if that does
2332    mean there is a level jump.  For example:
2334    : * Todays top priorities
2335    : **** TODO write a letter to xyz
2336    : **** TODO Finish the paper
2337    : **** Pick up kids at the school
2339    Alternatively, if you need a specific value for the heading/item
2340    transition in a particular file, use the =#+OPTIONS= line to
2341    configure the H switch.
2343    : #+OPTIONS:   H:2; ...
2345 ** Can I export only a single subtree?
2346    :PROPERTIES:
2347    :CUSTOM_ID: export-single-subtree
2348    :END:
2350    If you want to export a subtree, mark the subtree as region and then
2351    export.  Marking can be done with =C-c @ C-x C-x=, for example.
2353 ** How can I tell my calendar web application about appointments in my agenda files?
2355 Here is what you need to do:
2357 1. a script that calls Emacs in batch mode and produce a .ics file
2358 2. a script that uploads this .ics file somewhere on the web
2359 3. tell your webapp to fetch this .ics file on the web
2361 Here is the script I use for the first step:
2363 #+begin_src shell-script-mode
2364 #!/bin/bash
2366 /usr/local/bin/emacs --batch --eval \
2367 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2368         (load-file \"~/elisp/config/org-batch-config.el\") \
2369         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2370         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2371     -f org-export-icalendar-combine-agenda-files
2372 #+end_src
2374 Depending on your configuration, you might change the load sequence.
2376 Here is the script I use for the second step:
2378 #+begin_src shell-script-mode
2379 #!/bin/bash
2380 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2381 #+end_src
2383 Note: if you want to cron this rsync script, you will need to let
2384 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2385 starter.
2387 Now you can cron the two scripts above and your webapp will always be
2388 up to date with your Org agendas.
2390 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2392 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2393    :PROPERTIES:
2394    :CUSTOM_ID: iCal-import-ics-files-old
2395    :END:
2397    When using iCal under Apple MacOS X Tiger, you can create a new
2398    calendar /OrgMode/ (the default name for the calendar created by =C-c
2399    C-e c=, see the variables =org-icalendar-combined-name= and
2400    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2401    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2402    You may even use AppleScript to make iCal re-read the calendar files
2403    each time a new version of /OrgMode.ics/ is produced.  Here is the
2404    setup needed for this:
2406    : (setq org-combined-agenda-icalendar-file
2407    :     "~/Library/Calendars/OrgMode.ics")
2408    : (add-hook 'org-after-save-iCalendar-file-hook
2409    :  (lambda ()
2410    :   (shell-command
2411    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2413 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2414    :PROPERTIES:
2415    :CUSTOM_ID: iCal-import-ics-files-new
2416    :END:
2418    For Mac OS X 10.4, you need to write the ics file to
2419    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2420    =http: //localhost/orgmode.ics=
2422 ** How can I remove timestamps and todo keywords from my exported file?
2423    :PROPERTIES:
2424    :CUSTOM_ID: export-options-remove-timestamps
2425    :END:
2427 You can place an options line at the top of your org file:
2429 : #+OPTIONS: <:nil todo:nil
2431 There is a whole host of export options you can set with an in-buffer
2432 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2433 full list.
2435 ** How can I preserve faces when I export an agenda from the command line?
2436    :PROPERTIES:
2437    :CUSTOM_ID: preserving-faces-during-batch-export
2438    :END:
2440 Normally, when you export an org file or an agenda view from within
2441 emacs, htmlize will convert your face definitions to direct color css
2442 styles inlined into each =<span>= object, resulting in an HTML output
2443 that preserves the general look of your Org buffers and agenda views.
2445 Let's say you generate an export from the command line, such as the
2446 following:
2448 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2452 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2454 In such an instance, the exported HTML will contain only very basic
2455 color styles. The reason is that when Emacs is run in batch mode, it
2456 does not have a display and therefore only rudimentary face
2457 definitions.  If you'd like to use more complex styles, you'll have to
2458 make sure that the export process only assigns classes instead of
2459 direct color values.  This can be done by binding the variable
2460 =org-export-htmlize-output-style= to =css= for the duration of the
2461 export, for example with
2463 : emacs -batch -l ~/.emacs
2464 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
2465 :            (org-batch-agenda "e"))'
2467 Then you can use a style file to make these classes look any way you
2468 like.  To generate face definitions for a CSS file based on any faces
2469 you are currently using in Emacs, you can use the following command:
2471 : M-x org-export-htmlize-generate-css RET
2473 This will generate a =<style>...</style>= section, the content of
2474 which you can add to your style file.
2476 ** How can I avoid dark color background when exporting agenda to ps format?
2477    :PROPERTIES:
2478    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2479    :END:
2481 Add this to your .emacs and evaluate it.
2483 #+BEGIN_SRC emacs-lisp
2484   (setq org-agenda-exporter-settings
2485         '((ps-print-color-p 'black-white)))
2486 #+END_SRC
2488 ** How can I get colored source code when exporting to LaTeX?
2489    :PROPERTIES:
2490    :CUSTOM_ID: fontified_source_code_w_latex
2491    :END:
2493 As of Sun Aug 9 2009 the "current" version of Org-mode (see
2494 [[keeping-current-with-Org-mode-development]]) supports exporting source
2495 code to LaTeX using the listings package.
2497 To turn on listing export add the following to your Org-mode
2498 customization.
2499 #+begin_src emacs-lisp
2500   ;; requite org-latex so that the following variables are defined
2501   (require 'org-latex)
2502   
2503   ;; tell org to use listings
2504   (setq org-export-latex-listings t)
2505   
2506   ;; you must include the listings package
2507   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
2508   
2509   ;; if you want colored source code then you need to include the color package
2510   (add-to-list 'org-export-latex-packages-alist '("" "color"))
2511 #+end_src
2513 The listings package will now be used to fontify source code in your
2514 LaTeX documents.  By default listings will not color any of your
2515 source code.  If you would like to set colors for keywords and
2516 comments in your latex documents you can do so using LaTeX directives
2517 like the following.
2518 #+begin_src latex
2519   \lstset{keywordstyle=\color{blue},
2520     commentstyle=\color{red},
2521     stringstyle=\color{green}
2522   }
2523 #+end_src
2525 of if you want to get even fancier with your colors you can try
2526 something like the following
2527 #+begin_src latex
2528 \definecolor{keywords}{RGB}{255,0,90}
2529 \definecolor{comments}{RGB}{60,179,113}
2530 \definecolor{fore}{RGB}{249,242,215}
2531 \definecolor{back}{RGB}{51,51,51}
2532 \lstset{
2533   basicstyle=\color{fore},
2534   keywordstyle=\color{keywords},  
2535   commentstyle=\color{comments},
2536   backgroundcolor=\color{back}
2538 #+end_src
2540 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
2542 ** How can I export to Latex Beamer
2543    :PROPERTIES:
2544    :CUSTOM_ID: beamer
2545    :END:
2546 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
2547 The following can be used to export Org-mode documents to LaTeX
2548 beamer.
2550 Add the following to your Emacs initialization file.
2551 #+begin_src emacs-lisp
2552   (unless (boundp 'org-export-latex-classes)
2553     (setq org-export-latex-classes nil))
2554   (add-to-list 'org-export-latex-classes
2555                '("beamer"
2556                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
2557                  ("\\section{%s}" . "\\section*{%s}")
2558                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
2559                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
2560 #+end_src
2562 Then by placing
2563 : #+LaTeX_CLASS: beamer
2564 in the header of your Org-mode document it will automatically export
2565 to the Beamer document class on LaTeX export.  With the above
2566 configuration top-level headers will be mapped to sections in the
2567 Beamer document, second-level headers will be mapped to frames, and
2568 lower level headlines will be mapped to itemize objects.
2570 This above is adapted from an [[http://article.gmane.org/gmane.emacs.orgmode/15077/match=beamer+dokos][email by Nick Dokos]], and an [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
2571 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
2572 Thomas Dye]].
2574 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
2576 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
2577 aids in creation of bibliographies, cross-references, indexes, and
2578 glossaries.  RefTeX understands the structure of multi-file LaTeX
2579 documents and is able to collect from them information about the
2580 location(s) of external data stores used in creation of the final
2581 document.  RefTeX was written by Carsten Dominik and is currently
2582 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
2584 *** Using RefTeX In Org-mode Files for LaTeX Export
2585 In Org-mode files for LaTeX export, the trick is to find a way to tell
2586 RefTeX the locations of external data stores.  One way is to set the
2587 variable, =reftex-default-bibliography=.  Add lines like these to
2588 .emacs:
2590 #+begin_src emacs-lisp 
2591   (setq reftex-default-bibliography
2592         (quote
2593          ("default.bib" "other-default.bib")))       
2594 #+end_src
2596 In practice, this is a limited solution and the
2597 typical user will want to pass this information on a per-file basis.
2598 Two solutions to this problem were posted on a blog, [[http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/][Mario's
2599 Braindump]].  
2601 The first solution, proposed by Mario, enables the RefTeX citation
2602 function in Org-mode.  Add these lines to .emacs:
2604 #+begin_src emacs-lisp
2605   (defun org-mode-reftex-setup ()
2606     (load-library "reftex")
2607     (and (buffer-file-name)
2608          (file-exists-p (buffer-file-name))
2609          (reftex-parse-all))
2610     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
2611   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
2612 #+end_src
2614 Then add the following lines anywhere in the Org-mode file (Org-mode
2615 will recognize them as LaTeX commands):
2617 #+begin_src org
2618 \bibliographystyle{plain}
2619 \bibliography{BIB-NAME}
2620 #+end_src
2622 With this setup, =C-c )= will invoke =reftex-citation= which will
2623 insert a reference in the usual way:
2625 #+begin_src org
2626   ,* test reftex
2627   
2628   ,This is a citation \cite{tierney90}.
2629   
2630   ,\bibliographystyle{plain}
2631   ,\bibliography{tsd}
2632 #+end_src
2634 This Org-mode file will export the following LaTeX output:
2636 #+begin_src latex :exports code
2637   % Created 2010-03-22 Mon 14:34
2638   \documentclass[11pt,letter]{article}
2639   \usepackage[utf8]{inputenc}
2640   \usepackage[T1]{fontenc}
2641   \usepackage{hyperref}
2642   
2643   \title{test.org}
2644   \author{Tom Dye}
2645   \date{2010-03-22 Mon}
2646   
2647   \begin{document}
2648   
2649   \maketitle
2650   
2651   \setcounter{tocdepth}{3}
2652   \tableofcontents
2653   \vspace*{1cm}
2654   
2655   \section{test reftex}
2656   \label{sec-1}
2657   
2658   
2659   This is a citation \cite{tierney90}.
2660   
2661   \bibliographystyle{plain}
2662   \bibliography{tsd}
2663   
2664   \end{document}
2665 #+end_src
2668 A second solution, to activate the RefTeX minor mode on a per-file
2669 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
2670 Add the following lines to .emacs:
2672 #+begin_src emacs-lisp
2673   (add-hook ‘org-mode-hook
2674              (lambda ()
2675                (if (member “WRITE” org-todo-keywords-1)
2676                    (org-mode-article-modes))))
2677 #+end_src
2679 where =org-mode-article-modes= is defined as follows:
2681 #+begin_src emacs-lisp
2682   (defun org-mode-article-modes ()
2683     (reftex-mode t)
2684     (bib-cite-minor-mode t)
2685     (and (buffer-file-name)
2686          (file-exists-p (buffer-file-name))
2687          (reftex-parse-all)))
2688 #+end_src
2690 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
2691 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
2692 like this:
2694 #+begin_src org
2695   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
2696 #+end_src
2698 With this setup, you insert a citation with =M-x reftex-citation RET=.
2700 *** Using RefTeX in Org-babel LaTeX Code Blocks
2702 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
2703 information in other Org-babel LaTeX code blocks.  If you use an Emacs
2704 starter kit where configuration information is held in Org-mode files,
2705 then the second solution is preferable because you won't be asked for
2706 a master file when Emacs is started.  For this reason, the second
2707 solution is modified for use with Org-babel latex code blocks.  No
2708 key-binding is needed here because Org-babel code blocks are edited
2709 within the usual AucTeX environment.
2711 Add the following lines to .emacs (adapted from  Kevin Brubeck Unhammer's [[http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/][Reftex Setup]])
2712 #+begin_src emacs-lisp
2713   (defun org-mode-article-modes ()
2714     (reftex-mode t)
2715     (and (buffer-file-name)
2716          (file-exists-p (buffer-file-name))
2717          (reftex-parse-all)))
2718   
2719   (add-hook 'org-mode-hook
2720             (lambda ()
2721               (if (member "REFTEX" org-todo-keywords-1)
2722                   (org-mode-article-modes))))
2723 #+end_src
2725 Then add a line like the following line to the top of your org-mode file:
2727 #+begin_src org
2728   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
2729 #+end_src
2731 When you open an org-mode file with a line like this, RefTeX will
2732 prompt for the master .tex file, which will be parsed in the usual
2733 way.  This means that the .tex file should already exist, perhaps by
2734 tangling the LaTeX preamble and postamble, before
2735 =org-mode-article-modes= is activated for the Org-mode file.
2737 * MobileOrg
2739 ** Which versions of MobileOrg do exist
2740    :PROPERTIES:
2741    :CUSTOM_ID: mobileorg_versions
2742    :END:
2744 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
2745   Richard Moreland.  Check out
2746   [[http://mobileorg.ncogni.to/][Richard's page]]
2747 - Matt Jones is developing a feature-equivalent application for
2748   Android, see
2749   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
2751 ** What can I do if I don't want to use Dropbox.com
2752    :PROPERTIES:
2753    :CUSTOM_ID: mobileorg_webdav
2754    :END:
2756 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
2757 you can get a free account there.  If for some reason you cannot or do
2758 not want to use this path, you can use any webdav server.  On this
2759 webdav server you need to create a dedicated directory for the
2760 communication between Emacs and MobileOrg.  If you can mount that
2761 directory locally so that Emacs can directly write to it, just point
2762 to that directory using the variable =org-mobile-directory=.  Using
2763 the /tramp/ method, =org-mobile-directory= may point to a remote
2764 directory accessible through, for example, /ssh/ and /scp/:
2766 #+begin_src emacs-lisp
2767 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
2768 #+end_src
2770 If Emacs cannot access the WebDAV directory directly using a /tramp/
2771 method, you can use a local directory for staging.  Other means must
2772 then be used to keep this directory in sync with the WebDAV directory.
2773 In the following example, files are staged in =~/stage/=, and Org-mode
2774 hooks take care of moving files to and from the WebDAV directory using
2775 /scp/.
2777 #+begin_src emacs-lisp
2778 (setq org-mobile-directory "~/stage/")
2779 (add-hook 'org-mobile-post-push-hook
2780   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
2781 (add-hook 'org-mobile-pre-pull-hook
2782   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
2783 (add-hook 'org-mobile-post-pull-hook
2784   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
2785 #+end_src
2787 * COMMENT HTML style specifications
2789 #+begin_src emacs-lisp
2790   (defun org-faq-make-target ()
2791     "Make hard target for current headline."
2792     (interactive)
2793     (if (not (org-on-heading-p))
2794         (error "Not on a headline"))
2795     (let ((h (org-trim (org-get-heading 'no-tags))))
2796       (if (string-match "[ \t]*\\?\\'" h)
2797           (setq h (replace-match "" t t h)))
2798       (while (string-match "[ \t]+" h)
2799         (setq h (replace-match "-" t t h)))
2800       (org-entry-put nil "CUSTOM_ID" h)))
2801 #+end_src