Fix images locations.
[Worg.git] / org-faq.org
blobc7f297955bce9ab17d484fc502248a47f71d9010
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:info 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 ChangeLog and updated
209       sections of 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
354 ** How can I install an up-to-date version of org-mode without "make" tools?
355    :PROPERTIES:
356    :CUSTOM_ID: installing-org-without-make-tools
357    :END:
359 If you are using org-mode on a computer that lacks developer tools for
360 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
361 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
363 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
364 you can install a recent version of org-mode without using the
365 customary =make clean && make && make install=.
367 The result of that discussion is the file/function found in
368 [[http://orgmode.org/worg/org-hacks.php#compiling-org-without-make]].
370 * Setup
371   :PROPERTIES:
372   :CUSTOM_ID: Setup
373   :END:
375 ** How can I quickly browse all Org options?
377 =M-x org-customize RET=
379 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
380 for details.
382 ** Can I use the editing features of org-mode in other modes?
383    :PROPERTIES:
384    :CUSTOM_ID: use-editing-features-in-other-modes
385    :END:
387    Not really---but there are a few editing features you can use in
388    other modes.
390    - For tables there is =orgtbl-mode= which implements the table
391      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
392    - For ordered lists there is =orgstuct-mode= which allows for easy
393      list editing as a minor mode. (To enable, type =M-x
394      orgstruct-mode=)
396    You can activate these modes automatically by using hooks:
398    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
399    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
401    For footnotes, there is the function =org-footnote-action=, which
402    works in non-org buffers. This function is a powerful tool for
403    creating and sorting footnotes. To use it globally, you can add the
404    following keybinding to your =.emacs= file (requires Org 6.17 or
405    greater):
407    : (global-set-key (kbd "C-c f") 'org-footnote-action)
409    For other features you need to switch to Org-mode temporarily, or
410    prepare text in a different buffer.
412 ** Why isn't feature "X" working the way it is described in the manual?
413    :PROPERTIES:
414    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
415    :END:
417 Org-mode develops very quickly. There have been a great many changes,
418 for instance, since the release of Emacs 22, which shipped with
419 version 4.67d of org-mode. (Emacs 23 is expected to ship with version
420 6.21b.)
422 Many of the users on the org-mode mailing list are using either a
423 recent release of org-mode or the
424 [[http://orgmode.org/index.html#sec-3.2][development version of
425 org-mode from the git repository]].
427 If some settings and features aren't working the way you expect, make
428 sure that the version of the manual you are consulting matches the
429 version of org-mode you are using.
431    - You can check which version of org-mode you are using by
432      selection =Org --> Documentation --> Show Version= in the Emacs
433      menu.
435    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
436      release.
438    - 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
439      released with the latest official Gnu Emacs release (Emacs 22 and
440      org-mode 4.67d as of February 2009). Note: compared with the
441      manual at the orgmode.org, the manual at www.gnu.org is
442      considerably out of date.
444 For instructions on how to stay current with org-mode, consult [[keeping-current-with-Org-mode-development][this
445 FAQ]] or follow the instructions on [[http://orgmode.org][the official org-mode site]].
447 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
448    :PROPERTIES:
449    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
450    :END:
452    Yes, these functions are written in a way that they are independent of
453    the outline setup.  The following setup provides standard Org-mode
454    functionality in outline-mode on =TAB= and =S-TAB=.  For
455    outline-minor-mode, we use =C-TAB= instead of =TAB=,
456    because =TAB= usually has mode-specific tasks.
458 #+BEGIN_SRC emacs-lisp
459 (add-hook 'outline-minor-mode-hook
460   (lambda ()
461     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
462     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
463 (add-hook 'outline-mode-hook
464   (lambda ()
465     (define-key outline-mode-map [(tab)] 'org-cycle)
466     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
467 #+END_SRC
469 Or check out /outline-magic.el/, which does this and also provides
470 promotion and demotion functionality.  /outline-magic.el/ is
471 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
473 ** Can I save/restore the visibility state of an org-mode buffer?
475 Well, no.
477 ** How can I keep track of changes in my Org files?
478    :PROPERTIES:
479    :CUSTOM_ID: track-of-changes-in-Org-files
480    :END:
482   Use git to track the history of the files, use a cronjob to check in
483   changes regularly.  Such a setup is described by Bernt Hansen
484   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
486 ** Can I use Org-mode as the default mode for all README files?
487    :PROPERTIES:
488    :CUSTOM_ID: Org-mode-as-default-mode
489    :END:
491 Add the following to your .emacs file:
493 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
495 You can even make it the default mode for any files with unspecified
496 mode using
498 : (setq default-major-mode 'org-mode)
500 ** Can I use ido.el for completing stuff in Org?
501    :PROPERTIES:
502    :CUSTOM_ID: ido-complete
503    :END:
505    Yes, you can.  If you are an ido user and ido-mode is active, the
506    following setting will make Org use =ido-completing-read= for most
507    of its completing prompts.
509 : (setq org-completion-use-ido t)
511 ** Should I use one big org file or multiple files?
512    :PROPERTIES:
513    :CUSTOM_ID: how-to-organize-org-mode-files
514    :END:
516 Org-mode is flexible enough to accomodate a variety of organizational
517 and time management schemes. Org's
518 [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline
519 cycling and convenient editing and navigation commands]] make it
520 possible to maintain all of your projects and notes in a single file.
521 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
522 notes and todos]], also make it a delight to maintain a private "wiki"
523 consisting of multiple files.
525 No matter how you organize your org files, org-mode's agenda commands
526 make it easy to search all your notes and gather together crucial data
527 in a single view.
529 Moreover, several org-mode settings can be configured either globally
530 in your =.emacs= file or locally (per file or per outline tree). See
531 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
532 see [[limit-agenda-with-category-match][this FAQ]].
534 Here are a few ideas for organizing org-mode files:
536 - A single file for all your projects and notes.
537 - One file per project.
538 - One file per client.
539 - One file per area of responsibility or type of work (e.g.,
540   household, health, work, etc.).
541 - One file for projects, one for appointments, one for reference
542   material, one for someday/maybe items, etc.
543 - A wiki of hyperlinked files that grows and adapts to meet your
544   needs.
546 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
547 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
549 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
550    :PROPERTIES:
551    :CUSTOM_ID: setting-global-keybindings
552    :END:
554 Org-mode has a few global keybindings that the user must set
555 explicitly in an =.emacs= file. These keybindings include the
556 customary shortcut for calling the agenda (=C-c a=). If nothing
557 happens when you type =C-c a=, then make sure that the following lines
558 are in your =.emacs= file:
560 #+BEGIN_SRC emacs-lisp
561 ;; The following lines are always needed.  Choose your own keys.
562 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
563 (global-set-key "\C-cl" 'org-store-link)
564 (global-set-key "\C-ca" 'org-agenda)
565 (global-set-key "\C-cb" 'org-iswitchb)
566 #+END_SRC emacs-lisp
568 You may, of course, choose whatever keybindings work best for you
569 and do not conflict with other modes.
571 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
572 questions.
574 ** Why aren't some of the variables I've customized having an effect?
575    :PROPERTIES:
576    :CUSTOM_ID: load-org-after-setting-variables
577    :END:
579 Some org variables have to be set before org.el is loaded or else they
580 will not work. (An example is the new variable
581 =org-enforce-todo-dependencies=.)
583 To make sure all your variables work you should not use =(require
584 'org)=. Instead use the following setting:
586 : (require 'org-install)
588 You should also make sure that you do not require any other =org-...=
589 files in your =.emacs= file before you have set your org variables,
590 since these will also cause org.el to be loaded. To be safe, load org
591 files *after* you have set your variables.
593 ** Org-mode has a lot of colors?  How can I change them?
594    :PROPERTIES:
595    :CUSTOM_ID: customizing-org-faces
596    :END:
598 This is a question that applies to Emacs as a whole, but it comes up
599 quite frequently on the org-mode mailing list, so it is appropriate to
600 discuss it here.
602 If you would like to change the style of a face in org-mode (or any
603 other Emacs mode), simply type =M-x customize-face [RET]= while the
604 cursor is on the color/style you are interested in modifying. You will
605 be given the opportunity to customize all the faces located at that
606 point.
608 If you would like an overview of all the faces in org-mode, you can
609 type =C-u M-x list-faces-display [RET] org= and you will be shown all
610 the faces defined by org-mode along with an illustration of their
611 current settings.
613 If you would like to customize org-faces and other aspects of
614 org-appearance, type =M-x customize-group org-font-lock [RET]=.
616 Finally, if you would like verbose information about the properties of
617 the text under the cursor, you can type =C-u C-x ==.
619 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
621 ** How can I make sure that timestamps appear in English?
622    :PROPERTIES:
623    :CUSTOM_ID: timestamps-and-system-time-locale
624    :END:
626 If your system's locale is not set to English, but you would like the
627 timestamps in your org-mode files to appear in English, you can set
628 the following variable:
630 #+begin_src emacs-lisp
631   (setq system-time-locale "C")
632 #+end_src
634 * Errors and general problems
635   :PROPERTIES:
636   :CUSTOM_ID: Errors
637   :END:
638 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
639    :PROPERTIES:
640    :CUSTOM_ID: wrong-type-argument-keymapp
641    :END:
643    This is a conflict with an outdated version of the /allout.el/, see
644    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
646 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html.... 
647    :PROPERTIES:
648    :CUSTOM_ID: external-application-launched-to-open-file-link
649    :END:
651 If you want special control about how Org-mode opens files, see the
652 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
653 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
655 *However*, normally it is best to just use the mechanism the
656 operating-system provides:
658 *** GNU/Linux systems
659     You you have to check your mailcap settings, find the files:
661     : /etc/mailcap
662     : 
663     : or  
664     : 
665     : $HOME/.mailcap
667 and modify them accordingly. Please read their manual entry.
669 *** Windows systems 
670     + for html pages you may configure the =browse-url-= variables through
671       the Customize interface,
672     + the pdf files are automatically opened with Acrobat Reader (if it is
673       installed)
675 *** Mac OSX
676     Change the application responsible for this file type by selecting
677     such a file in the Finder, select =File->Get Info= from the menu
678     and select the application to open this file with.  Then, to
679     propagate the change to all files with the same extension, select
680     the =Change all= button.
682 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
683    :PROPERTIES:
684    :CUSTOM_ID: YASnippet
685    :END:
687 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
688 inspired by TextMate's templating syntax.
689 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
690 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
692 *Note*: yasnippet is not compatible with =org-indent-mode= currently
693 there is no known way to use both successfully with =yas/trigger-key=
694 set to =TAB= (or =[tab]= etc...)
696 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
697 =\t=) overrules yasnippets' access to this key.  The following code
698 fixes this problem:
700 #+begin_src emacs-lisp
701 (add-hook 'org-mode-hook
702           (lambda ()
703             (org-set-local 'yas/trigger-key [tab])
704             (define-key yas/keymap [tab] 'yas/next-field-group)))
705 #+end_src
707 If the above code doesn't work (which it may not with later versions
708 of yasnippet).  Then try the following
710 #+begin_src emacs-lisp
711   (defun yas/org-very-safe-expand ()
712     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
713   
714   (add-hook 'org-mode-hook
715             (lambda ()
716               ;; yasnippet (using the new org-cycle hooks)
717               (make-variable-buffer-local 'yas/trigger-key)
718               (setq yas/trigger-key [tab])
719               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
720               (define-key yas/keymap [tab] 'yas/next-field)))
721 #+end_src
723 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]])
724 with YASnippets for Org-mode.
726 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
727    :PROPERTIES:
728    :CUSTOM_ID: CUA-mode
729    :END:
731 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
733 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
734    :PROPERTIES:
735    :CUSTOM_ID: windmove.el
736    :END:
738 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
740 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
741    :PROPERTIES:
742    :CUSTOM_ID: loaded-old-org
743    :END:
745 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=.
747 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.
749 You should add your directories to the =load-path= at the beginning:
751 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
753 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)=.
755 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.
757 ** Why doesn't org-batch-agenda work under Win32?
758    :PROPERTIES:
759    :CUSTOM_ID: org-batch-agenda-under-win32
760    :END:
762 When I run the example batch files to print my agenda to the console
763 under Win32 I get the failure:
765 : End of file during parsing
767 and no agenda is printed.
769 The problem is the use of single quotes surrounding the eval in the
770 emacs command-line. This gets confused under Win32. All string
771 parameters with spaces must be surrounded in double quotes. This means
772 that double quotes being passed to the eval must be escaped.
774 Therefore, instead of the following:
776 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
777 :     -eval '(org-batch-agenda "a")'
779 you need to use the following:
781 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
782 :     -eval "(org-batch-agenda \"a\")"
784 (all on one line, of course).
786 ** Org agenda seems very slow
787    :PROPERTIES:
788    :CUSTOM_ID: slow-agenda
789    :END:
791 If it takes a long time to generate or refresh the agenda, you might
792 want first check which version of org-mode you are using. There have
793 been major optimizations of org-agenda since 6.21b, which was the
794 version of org-mode released with Emacs 23. If you are using 6.21b or
795 earlier (you can check with =M-x org-version=), then you might want to
796 consider upgrading to a more recent version of org-mode.
798 Here are some other ideas for speeding up the agenda:
800 1. Use a one day agenda view (rather than a seven day view).
802    =(setq org-agenda-ndays 1)=
804 2. Archive inactive items to separate files.
805    
806    =C-c C-x C-s= (org-archive-subtree)
808 3. Do not include the global todo list in your agenda view.
810    (setq org-agenda-include-all-todo nil)
812 4. Make sure that your org files are byte-compiled.
814    I.e., make sure there are files ending in .elc in your org
815    installation directory.
817 ** Visual-line-mode doesn't work well with org-mode
818    :PROPERTIES:
819    :CUSTOM_ID: visual-line-mode
820    :END:
822 Visual-line-mode "soft wraps" lines so that the visual edge of the
823 buffer is considered a line break for purposes of navigation, even
824 though there is no line break in reality. 
826 In older versions of org-mode, org-beginning-of-line and
827 org-end-of-line do not work well with visual line mode. (The two
828 commands disregard soft line breaks and move to the beginning and end
829 of the hard line break.) A patch was introduces to fix this behavior
830 in July of 2009. n
832 If you are using an older version of org mode, you can:
834 1. Add a hook to turn off visual line mode.
836 2. Add the following to your =.emacs=:
838 #+begin_src emacs-lisp
840 (add-hook 'org-mode-hook
841   (lambda ()
842     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
843     (define-key org-mode-map "\C-e" 'move-end-of-line)))
845 #+end_src
847 * Outline
848   :PROPERTIES:
849   :CUSTOM_ID: Outline
850   :END:
851 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
852    :PROPERTIES:
853    :CUSTOM_ID: indirect-buffers
854    :END:
856    You may use /indirect buffers/ which do exactly this.  See the
857    documentation on the command =make-indirect-buffer=.
859    Org-mode has built-in commands that allow you create an indirect
860    buffer from a subtree of an outline. To open a subtree in new
861    window, type =C-c C-x b=. Any changes you make in the new window
862    will be saved to the original file, but the visibility of both
863    buffers will remain independent of one another.
865    For multiple indirect buffers from the same file, you must use the
866    prefix =C-u= when creating the second (or third) buffer. Otherwise
867    the new indirect buffer will replace the old.
869    You can also create an independent view of an outline subtree by
870    typing =b= on an item in the agenda.
872 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
873    :PROPERTIES:
874    :CUSTOM_ID: Emacs-outlines-are-unreadable
875    :END:
877    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
878 ** C-k is killing whole subtrees!  I lost my work!
879    :PROPERTIES:
880    :CUSTOM_ID: C-k-is-killing-subtrees
881    :END:
883   =(setq org-special-ctrl-k t)= before losing your work.
885 ** Why aren't commands working on regions?
886    :PROPERTIES:
887    :CUSTOM_ID: transient-mark-mode
888    :END:
890 Some org-mode commands, such as M-right and M-left for demoting or
891 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
892 These commands, however, will only work on active regions set with
893 [[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
894 Emacs 23. To enable it in earlier versions of emacs, put the following
895 in your =.emacs= file:
897 : (transient-mark-mode 1)
899 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
900 momentary mark]] (=C-<SPC> C-<SPC>=).
902 ** Why is a blank line inserted after headlines and list items?
903    :PROPERTIES:
904    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
905    :END:
906    :PROPERTIES:
907    :CUSTOM_ID: blank-line-after-headlines-and-list-items
908    :END:
910 In org-mode, typing =M-RET= at the end of a headline will create a new
911 headline of the same level on a new line. The same is true for plain
912 lists. By default org-mode uses context to determine if a blank line
913 should be inserted after each headline or plain list item when =M-RET=
914 is pressed. For instance, if a there is a blank line before a
915 headline, then typing =M-RET= at the end of the line will insert a
916 blank line before the new headline. For instance, hitting =M-RET=
917 at the end of "Headline Two" below inserts a new headline without a
918 blank line:
920 : ** Headline One
921 : ** Headline Two
922 : **
924 If there is a blank line between Headline One and Headline Two,
925 however, the results will be as follows:
927 : ** Headline One
929 : ** Headline Two
931 : **
933 If you do not like the default behavior you can change it with the
934 variable =org-blank-before-new-entry=. You can set headings and/or
935 plain lists to auto (the default setting), t (always), or nil (never).
937 ** How can I promote or demote multiple headlines at once?
938    :PROPERTIES:
939    :CUSTOM_ID: demote-multiple-headlines
940    :END:
942 If you have a long list of first level headlines that you'd like to
943 demote to second level headlines, you can select the headlines as a
944 region and then hit =M-<right>= to demote all the headlines at once.
946 Note: =M-S-<right>= will not work on a selected region. Its use is to
947 demote a single subtree (i.e., a headline and all sub-headlines).
949 If M-<right> doesn't seem to work, make sure transient mark mode is
950 enabled. See [[transient-mark-mode][this FAQ]].
952 ** What's the deal with all the ellipses in my org outlines?
953    :PROPERTIES:
954    :CUSTOM_ID: org-ellipses
955    :END:
957 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
958 commonly, ellispes occur at the end of headings with folded content:
960 : * Heading ...
962 Or, for instance, they may indicate closed drawers:
964 : :PROPERTIES: ...
966 Sometimes, as a result of editing and cycling an outline, ellipses may
967 appear in unexpected places. You should *never* delete these ellipses,
968 as you may accidentally delete hidden text. Instead, you can type =C-c
969 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
970 may type =M-x RET show-all= to reveal all text in the org file.
972 If you would prefer a symbol or face for indicating hidden text, you
973 can customize the variable org-ellipses.
975 ** How do I yank a subtree so it's indented according to points' location?
976    :PROPERTIES:
977    :CUSTOM_ID: yank-indent-subtree
978    :END:
980 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
982 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
983 yanked headline's level correctly.
985 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
987 * Todos and Tags
988   :PROPERTIES:
989   :CUSTOM_ID: Todos-and-Tags
990   :END:
991 ** How can I cycle through the TODO keyword of an entry?
992    :PROPERTIES:
993    :CUSTOM_ID: cycle-TODO-keywords
994    :END:
996   =C-c C-t= or =S-<left/right>= is what you need.
998 ** How do I track state changes for tasks in Org?
999    :PROPERTIES:
1000    :CUSTOM_ID: track-state-changes-for-tasks
1001    :END:
1003   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1004   states and logging timestamps for task state changes.
1006 ** Can I select the TODO keywords with a tag-like interface?
1007    :PROPERTIES:
1008    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1009    :END:
1011   Yes.  Use =(setq org-use-fast-todo-selection t)=
1013   If you want to set both your todos and your tags using a single
1014   interface, then check out the variable
1015   =org-fast-tag-selection-include-todo=.
1017   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1019 ** How can I quickly set the tag of an entry?
1020    :PROPERTIES:
1021    :CUSTOM_ID: quickly-set-tag-of-entry
1022    :END:
1024    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1025    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1026    keybinding for filing a note from the remember buffer.
1028    You can set tags even more quickly by setting one of the character
1029    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1031    To set tag shortcuts for all org buffers, put something like the
1032    following in your =.emacs= file (or create the same settings by
1033    typing =M-x customize-variable RET org-tag-alist=):
1035 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1037    To set tag shortcuts for a single buffer, put something like the
1038    following at the top of your org file:
1040 : #+TAGS: computer(c) office(o) home(h)
1042 ** How can I change the colors of TODO keywords?
1044 You can use the variable org-todo-keyword-faces. Here are some sample
1045 settings:
1047 #+begin_src emacs-lisp
1048 (setq org-todo-keyword-faces
1049       '(
1050         ("TODO"  . (:foreground "firebrick2" :weight bold))
1051         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1052         ("LATER"  . (:foreground "sienna" :weight bold))
1053         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1054         ("DONE"  . (:foreground "forestgreen" :weight bold))
1055         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1056         ("CANCELED"  . shadow)
1057         ))
1058 #+end_src
1060 If you want to change the color of all active todos or all inactive
1061 todos, type:
1063 : M-x customize-face RET org-todo
1064 : M-x customize-face RET org-done
1066 You can also set values for each of these in your =.emacs= file:
1068 : (set-face-foreground 'org-todo "firebrick2")
1069 : (set-face-foreground 'org-done "forestgreen")
1071 * Hyperlinks
1072   :PROPERTIES:
1073   :CUSTOM_ID: Hyperlinks
1074   :END:
1075 ** Why do I have to confirm the execution of each shell/elisp link?
1076    :PROPERTIES:
1077    :CUSTOM_ID: confirm-shell/elisp-link
1078    :END:
1080    The confirmation is there to protect you from unwantingly execute
1081    potentially dangerous commands.  For example, imagine a link
1083    : [[shell:rm -rf ~/*][Google Search]]
1085    In an Org-mode buffer, this command would look like /Google Search/,
1086    but really it would remove your home directory.  If you wish, you can
1087    make it easier to respond to the query by setting
1089    : (setq org-confirm-shell-link-function 'y-or-n-p
1090    :       org-confirm-elisp-link-function 'y-or-n-p).
1092    Then a single keypress will be enough to confirm those links.  It is
1093    also possible to turn off this check entirely, but I strongly
1094    recommend against this.  Be warned.
1096 ** Can I use RET or TAB to follow a link?
1097    :PROPERTIES:
1098    :CUSTOM_ID: RET-or-TAB-to-follow-link
1099    :END:
1101    Yes, this is how:
1103    : (setq org-return-follows-link t)
1104    : (setq org-tab-follows-link t)
1106 ** Can I keep mouse-1 clicks from following a link?
1107    :PROPERTIES:
1108    :CUSTOM_ID: mouse-1-following-link
1109    :END:
1111    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1112    link behavior similar to other applications like web browsers.  If
1113    you hold the mouse button down a bit longer, the cursor will be set
1114    without following the link.  If you cannot get used to this behavior,
1115    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1116    link activation for =mouse-1= with
1118    : (setq org-mouse-1-follows-link nil)
1120 ** How can I get completion of file names when creating a link?
1121    :PROPERTIES:
1122    :CUSTOM_ID: completion-of-file-links
1123    :END:
1125 You can use org-insert-link with a prefix argument:
1127 : C-u C-c C-l
1129 You will be greeted with prompt in the minibuffer that allows for file
1130 completion using your preferred Emacs method for finding files.
1132 * Plain Lists
1133   :PROPERTIES:
1134   :CUSTOM_ID: Plain-Lists
1135   :END:
1136 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1137    :PROPERTIES:
1138    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1139    :END:
1141 : (setq org-blank-before-new-entry
1142 :       '((heading . t) (plain-list-item . nil))
1144 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1146 ** How can I convert itemized lists to enumerated lists?
1147    :PROPERTIES:
1148    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1149    :END:
1151    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1152    bullet headlines available for lists: =-, +, *, 1., 1)=.
1154    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1156 ** How can I convert plain lists to headlines and vice versa?
1157    :PROPERTIES:
1158    :CUSTOM_ID: convert-plain-lists-to-headlines
1159    :END:
1161    To convert a plain list item or line to a headline, type =C-c *= on
1162    the headline. This will make the line a subheading of the current
1163    headline.
1165    To convert a headline to a plain list item, type =C-c -= while the
1166    cursor is on the headline.
1168    To convert a headline to an unadorned line of text, type =C-c *= on
1169    the headline.
1171    You can use query replace to accomplish the same things, as Bernt
1172    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1174 ** Is there a good way to create a description list?
1175    :PROPERTIES:
1176    :CUSTOM_ID: description-lists
1177    :END:
1179   Yes, these are now built-in:
1181 #+BEGIN_EXAMPLE
1182 - item1 :: Description of this item 1
1183 - item2 :: Description of this item 2
1184 - item1 :: Description of this item 3
1185       also in multiple lines
1186 #+END_EXAMPLE
1188 * Tables
1189   :PROPERTIES:
1190   :CUSTOM_ID: Tables
1191   :END:
1192 ** Can I plot data from a table?
1193    :PROPERTIES:
1194    :CUSTOM_ID: plotting-table-data
1195    :END:
1197    Yes, you can, using org-plot.el written by James TD Smith and now
1198    bundled with Org.  See [[http://orgmode.org/manual/Org-Plot.html#Org-Plot][the manual section about this]].
1200    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1202 ** How can I fill a table column with incremental numbers?
1203    :PROPERTIES:
1204    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1205    :END:
1207 Here is how: Use a field formula to set the first value in the column:
1209 #+begin_src org
1210 ,| N   |   |
1211 ,|-----+---|
1212 ,| :=1 |   |
1213 ,|     |   |
1214 ,|     |   |
1215 ,|     |   |
1216 ,#+TBLFM: @2$1=1
1217 #+end_src
1219 Then define a column formula in the second field:
1221 #+begin_src org
1222 ,| N        |   |
1223 ,|----------+---|
1224 ,| 1        |   |
1225 ,| =@-1 + 1 |   |
1226 ,|          |   |
1227 ,|          |   |
1228 ,#+TBLFM: @2$1=1
1229 #+end_src
1231 After recomputing the table, the column will be filled with
1232 incremental numbers:
1234 #+begin_src org
1235 ,| N |   |
1236 ,|---+---|
1237 ,| 1 |   |
1238 ,| 2 |   |
1239 ,| 3 |   |
1240 ,| 4 |   |
1241 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1242 #+end_src
1244 Note that you could use arbitrary starting values and column formulas.
1246 ** Why does my table column get filled with #ERROR?
1247    :PROPERTIES:
1248    :CUSTOM_ID: table-column-filled-with-ERROR
1249    :END:
1251    Org-mode tried to compute the column from other fields using a
1252    formula stored in the =#+TBLFM:= line just below the table, and
1253    the evaluation of the formula fails.  Fix the fields used in the
1254    formula, or fix the formula, or remove it!
1256 ** How can I stop the table editor from creating new lines?
1257    :PROPERTIES:
1258    :CUSTOM_ID: table-editor-creates-new-lines
1259    :END:
1261    When I am in the last column of a table and just above a horizontal
1262    line in the table, pressing TAB creates a new table line before the
1263    horizontal line.  To move to the line below the
1264    horizontal line instead, do this:
1266    Press =down= (to get on the separator line) and then =TAB=.
1267    Or configure the variable
1269    : (setq org-table-tab-jumps-over-hlines t)
1271 ** How can I get table fields starting with "="?
1272    :PROPERTIES:
1273    :CUSTOM_ID: table-fields-starting-with-=
1274    :END:
1276    With the setting
1278    : (setq org-table-formula-evaluate-inline nil)
1280    this will no longer happen.  You can still use formulas using the
1281    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1283 ** How can I change the indentation of an entire table without fixing every line by hand?
1284    :PROPERTIES:
1285    :CUSTOM_ID: change-indentation-entire-table
1286    :END:
1288    The indentation of a table is set by the first line.  So just fix the
1289    indentation of the first line and realign with =TAB=.
1291 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1292    :PROPERTIES:
1293    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1294    :END:
1296    Either split the table into several by inserting an empty line every
1297    100 lines or so.  Or turn off the automatic re-align with
1299    : (setq org-table-automatic-realign nil)
1301    After this the only way to realign a table is to press =C-c C-c=.  It
1302    will no longer happen automatically, removing the corresponding delays
1303    during editing.
1305 ** Recalculation of my table takes too long.  What can I do?
1306    :PROPERTIES:
1307    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1308    :END:
1310    Nothing, really.  The spreadsheet in org is mostly done to make
1311    calculations possible, not so much to make them fast.  Since Org-mode
1312    is firmly committed to the ASCII format, nothing is stopping you from
1313    editing the table by hand.  Therefore, there is no internal
1314    representation of the data.  Each time Org-mode starts a computation,
1315    it must scan the table for special lines, find the fields etc.  This
1316    is slow.  Furthermore, Calc is slow compared to hardware
1317    computations.  To make this work with normal editing, recalculation
1318    is not happening automatically, or only for the current line, so that
1319    the long wait for a full table iteration only happens when you ask
1320    for it.
1322    So for really complex tables, moving to a "real" spreadsheet may
1323    still be the best option.
1325    That said, there are some ways to optimize things in Org-mode, and I
1326    have been thinking about moving a bit further down this line.
1327    However, for my applications this has so far not been an issue at
1328    all.  If you have a good case, you could try to convince me.
1330 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1331    :PROPERTIES:
1332    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1333    :END:
1335    Well, it is /supposed/ to be a feature, to make it easy to create a
1336    column with increasing numbers.  If this gets into your way, turn it
1337    off with
1339    : (setq org-org-table-copy-increment nil)
1341 ** When I export tables to html, they don't have borders.
1342    :PROPERTIES:
1343    :CUSTOM_ID: table-borders-in-html-export
1344    :END:
1346 By default, org mode exports tables without borders.
1348 You can changed this by placing an =#+ATTR_HTML= line before the
1349 table:
1351 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1353 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1355 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1356    :PROPERTIES:
1357    :CUSTOM_ID: table-high-precision
1358    :END:
1360 - *Short answer*
1362   Avoid
1363   : | 0.16666667000000 |
1364   : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1365   and use
1366   : | 0.16666666666667 |
1367   : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1369 - *Longer answer*
1371   It is important to distinguish between the precision of
1372   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1373   2) =f14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1374   3) =%.14f=: the =printf= reformatting, limited in precision
1376   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.
1378   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1379   which are used if no format specifiers are added to a table formula.
1380   The examples below have been made with the out_of_the_box Org defaults
1381   =calc-internal-prec = 12= and =calc-float-format = 8=.
1383   Remember the formula debugger, toggled with =C-c {=,
1384   to view the processing stages like:
1385   |   | formula debugger label | processing stage           |
1386   | / | <                      | <>                         |
1387   |---+------------------------+----------------------------|
1388   |   | Result:                | output of Calc             |
1389   |   | Format:                | reformatting with =printf= |
1391   Following are some examples to demonstrate
1392   the interaction of the three precisions.
1394   - *display precision limitations for Calc formulas*
1395     - limited by Calc internal calculation precision from Org default
1396       (here =p12=)
1397       : | 0.16666666666700 |
1398       : #+TBLFM: $1 = 1 / 2 * 3;     f14
1400       : | 0.1666666666670000000 |
1401       : #+TBLFM: $1 = 1 / 2 * 3;     f19
1403     - limited by Calc float format from Org default (here =f8=)
1404       : | 0.16666667 |
1405       : #+TBLFM: $1 = 1 / 2 * 3
1407       : | 0.16666667 |
1408       : #+TBLFM: $1 = 1 / 2 * 3; p20
1410       : | 0.16666667000000 |
1411       : #+TBLFM: $1 = 1 / 2 * 3;         %.14f
1413       : | 0.16666667000000 |
1414       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.14f
1416     - limited by Calc float format specified
1417       : | 0.166667 |
1418       : #+TBLFM: $1 = 1 / 2 * 3;     f6
1420       : | 0.16666666666667 |
1421       : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1423       : | 0.1666666666666666667 |
1424       : #+TBLFM: $1 = 1 / 2 * 3; p20 f19
1426     - limited by =printf= conversion to Emacs Lisp float
1427       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1428       : #+TBLFM: $1 = 1 / 2 * 3;         %.19f
1430       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1431       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.19f
1433       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1434       : #+TBLFM: $1 = 1 / 2 * 3; p20 f20 %.19f
1436     - limited by =printf= format specified
1437       : | 0.166667 |
1438       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1440   - *display precision limitations for Emacs Lisp formulas*
1441     - limited by Emacs Lisp float
1442       : | 0.16666666666666666 |
1443       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1445       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1446       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1448     - limited by =printf= format specified
1449       : | 0.16666666666667 |
1450       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1452 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1453 and is continued in the [[#table-float-fraction][next FAQ entry]].
1455 ** Which float format shows the fraction part also when the latter is zero?
1456    :PROPERTIES:
1457    :CUSTOM_ID: table-float-fraction
1458    :END:
1460 - *Short answer*
1462   Avoid
1463   : | 1 |
1464   : #+TBLFM: $1 = 1 + 0; f3
1465   and use
1466   : | 1.000 |
1467   : #+TBLFM: $1 = 1 + 0; %.3f
1469 - *Longer answer*
1471   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]]
1472   in the section Mode Settings -> Display Modes -> Float Formats
1473   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is kept]].
1475   Remember the formula debugger, toggled with =C-c {=,
1476   to view the processing stages like:
1477   |   | formula debugger label | processing stage           |
1478   | / | <                      | <>                         |
1479   |---+------------------------+----------------------------|
1480   |   | Result:                | output of Calc             |
1481   |   | Format:                | reformatting with =printf= |
1483   Following are some examples to demonstrate different float formats.
1485   - normal precision
1486     : |----------------------+---------+-------+-------|
1487     : | number               |      f3 |   f-3 |  %.3f |
1488     : |----------------------+---------+-------+-------|
1489     : | 1 + 0                |       1 |     1 | 1.000 |
1490     : | 0 + 0                |       0 |     0 | 0.000 |
1491     : |----------------------+---------+-------+-------|
1492     : | 1 + 1 / 2 * 3 * 1000 |   1.000 | 1.000 | 1.000 |
1493     : | 0 + 1 / 2 * 3 * 1000 | 1.67e-4 | 0.000 | 0.000 |
1494     : |----------------------+---------+-------+-------|
1495     : | 1 + 1 / 2 * 3 *  100 |   1.002 | 1.002 | 1.002 |
1496     : | 0 + 1 / 2 * 3 *  100 |   0.002 | 0.002 | 0.002 |
1497     : |----------------------+---------+-------+-------|
1498     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1; %.3f
1500   - high precision
1501     : |----------------------+--------------------------+-----------------------|
1502     : | number               |                      f19 |                  f-19 |
1503     : |----------------------+--------------------------+-----------------------|
1504     : | 1 + 0                |                        1 |                     1 |
1505     : | 0 + 0                |                        0 |                     0 |
1506     : |----------------------+--------------------------+-----------------------|
1507     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1508     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1509     : |----------------------+--------------------------+-----------------------|
1510     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1511     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1512     : |----------------------+--------------------------+-----------------------|
1513     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1515     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1516     see the [[#table-high-precision][previous FAQ entry]].
1518 * Markup
1519   :PROPERTIES:
1520   :CUSTOM_ID: Footnotes
1521   :END:
1522 ** How can I get automatic renumbering of footnotes in org-mode?
1523    :PROPERTIES:
1524    :CUSTOM_ID:       footnote-auto-adjust
1525    :END:
1527 You can add the following line to your .emacs file:
1529 : (setq org-footnote-auto-adjust t)
1531 Or, if you prefer, you can turn this option on locally by placing the
1532 following line at the top of your org file:
1534 : #+STARTUP: fnadjust
1536 When auto-adjust is turned on, footnotes in the file with numerical
1537 labels will be renumbered whenever a new footnote is added. Meanwhile,
1538 all footnotes, including those with custom labels such
1539 =[fn:custom-label ]=, will be sorted in the order of their appearance
1540 in the text.
1542 This emulates the footnote behavior that many users may be familiar
1543 with from word-processing programs or from the footnote-mode included
1544 with emacs.
1546 If you do not turn on org-footnote-auto-adjust, you sort and/or
1547 renumber footnotes at any time by calling org-footnote-action with a
1548 prefix argument.
1550 ** Why isn't auto renumbering of footnotes turned on by default?
1551    :PROPERTIES:
1552    :CUSTOM_ID:       why-no-default-auto-adjust
1553    :END:
1555 Org mode has a very robust footnote mechanism allowing for a variety
1556 of types of footnotes. With some of the following footnote notations,
1557 auto-adjust may be either irrelevant or undesired:
1559  - Automatically numbered
1560  - Footnotes with custom labels
1561  - Inline footnotes
1563 In addition, org mode can be customized to place footnotes either at
1564 the end of a document or at the end of the outline heading in which
1565 they appear. Users who change this setting while editing a document
1566 may be disconcerted to find all of their footnotes rearranged
1567 automatically.
1569 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1570    :PROPERTIES:
1571    :CUSTOM_ID: auto-fill-and-unwanted-comments
1572    :END:
1574 If the following occurs:
1576 #+begin_src org
1578 #+OPTIONS: toc:nil
1579 Some entered text.
1580 # More entered tex.
1582 #+end_src
1584 Make sure that the variable comment-start is nil.
1586 ** Are there any shortcuts for entering source blocks and comment lines?
1587    :PROPERTIES:
1588    :CUSTOM_ID: shortcuts-for-entering-source-blocks
1589    :END:
1591 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
1592 and lines of code in a file. (This is especially useful when exporting
1593 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
1594 blocks of code.)
1596 #+begin_src org
1597   ,#+begin_src perl
1598   ,  print "Hello, world!\n";
1599   ,#+end_src
1600 #+end_src
1602 It can be tiresome to enter the block comment lines manually. There
1603 are several possible shortcuts you can use to enter them:
1605 1) Built-in expansion
1607    - Org mode has a "secret" method of expanding source code blocks
1608      and comment lines.
1610    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
1611      magically appear.
1613    - For a full list of expansions, type =M-x describe-variable
1614      [RET] org-structure-template-alist=.
1616 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
1618    - Add the following line to your emacs file:
1620      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
1622    - Then type =C-x r i p= to insert the source block. Please note: if
1623      you save another value to the register "p" with =C-x r s p=, it
1624      will overwrite the setting above for the current emacs session.
1626 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
1628  - Activate the abbrev minor-mode in org-mode:
1630    + M-x abbrev-mode
1632    + /Permanently/:
1634        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
1636  - In org-mode, type "sbp" (a sample abbreviation for a perl source
1637    block).
1639  - Immediately after "sbp" type =C-x a i l=.
1641  - Enter the expansion: 
1643    - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
1645    - Note: =C-q C-j= creates a new line in the minibuffer
1647  - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
1648    org-mode buffer, the src block will magically appear.
1650  - To review your list of abbrevs, type =M-x edit-abbrevs=.
1652  - If you want more complex completion (like yasnippet) you can combine
1653    abbrev mode with [[http://www.emacswiki.org/emacs/SkeletonMode][skeletons]].
1655 4) [[http://code.google.com/p/yasnippet/][Yasnippet]]
1657  - Several org-mode users install yasnippet for convenient, complex
1658    expansion.
1660  - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
1661    yasnippet.
1663 * Remember
1664   :PROPERTIES:
1665   :CUSTOM_ID: Remember
1666   :END:
1667 ** Can I use the remember buffer to clock a customer phone call?
1668    :PROPERTIES:
1669    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
1670    :END:
1672   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
1673   and check out (in the same thread) what Nick Docos had to fix to
1674   make Bernt's set-up work for him.
1675 ** Can I automatically start the clock when opening a remember template?
1676    :PROPERTIES:
1677    :CUSTOM_ID: start-clock-when-opening-remember-template
1678    :END:
1680    Yes, this is possible.  Use the following code and make sure that
1681    after executing it, `my-start-clock-if-needed' is in
1682    `remember-mode-hook' /after/ `org-remember-apply-template'.
1684    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
1685    : (defun my-start-clock-if-needed ()
1686    :   (save-excursion
1687    :     (goto-char (point-min))
1688    :     (when (re-search-forward " *CLOCK-IN *" nil t)
1689    :       (replace-match "")
1690    :       (org-clock-in))))
1692    Then, when a template contains the key string CLOCK-IN, the clock
1693    will be started.  Starting with Org-mode version 5.20, the clock will
1694    automatically be stopped when storing the remember buffer.
1696 * Searches
1697   :PROPERTIES:
1698   :CUSTOM_ID: Searches
1699   :END:
1700 ** Isearch does not find string hidden in links.  What can I do?
1701    :PROPERTIES:
1702    :CUSTOM_ID: isearch-in-links
1703    :END:
1705   M-x =visible-mode= will display the full link, making them searchable.
1707 ** How can I reduce the amount of context shown in sparse trees?
1708    :PROPERTIES:
1709    :CUSTOM_ID: context-in-sparse-trees
1710    :END:
1712    Take a look at the following variables:
1714    - =org-show-hierarchy-above=
1715    - =org-show-following-headline=
1716    - =org-show-siblings=
1717    - =org-show-entry-blow=
1719    which give command-dependent control over how much context is shown
1720    by a particular operation.
1722 ** How can I combine the results of two calls to =org-occur=?
1723    :PROPERTIES:
1724    :CUSTOM_ID: two-calls-to-org-occur
1725    :END:
1727    You can construct a regular expression that matches all targets you
1728    want.  Alternatively, use a =C-u= prefix with the second and any
1729    further calls to =org-occur= to keep the current visibility and
1730    highlighting in addition to the new ones.
1732 * Agenda
1733   :PROPERTIES:
1734   :CUSTOM_ID: Agenda
1735   :END:
1736 ** How can I change the advanced warning time for deadlines?
1737 ##<<warning-period-for-deadlines>>
1739 Deadline warnings appear in the daily agenda view a specified number
1740 of days before the deadline is due. The default setting is 14 days.
1741 You can change this with the variable =org-deadline-warning-days=.
1742 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
1744 For instance,
1746 : (setq org-deadline-warning-days 30)
1748 would cause warnings for each deadline to appear 30 days in advance.
1750 Naturally, you might not want warnings for all of your deadlines to
1751 appear so far in advance. Thus, you can change the lead time for
1752 individual items as follows:
1754 : * TODO Get a gift for the party
1755 :   DEADLINE: <2009-01-16 Fri -2d>
1757 The "-2d" above changes the lead time for this deadline warning to two
1758 days in advance. You can also use "w" for weeks and "m" for months.
1759 ** How can I postpone a task until a certain date?
1760    :PROPERTIES:
1761    :CUSTOM_ID: deferring-tasks
1762    :END:
1764 The easiest way to postpone a task is to schedule it in the future.
1765 For instance, typing =C-c C-s +2w= on a headline will push a task two
1766 weeks into the future, so that it won't show up on the daily agenda
1767 until two weeks from now.
1769 If you'd like to prevent the task from showing up on your global todo
1770 list, you have a couple of options.
1772 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
1773    This will exclude any scheduled items from your global list of
1774    active todos (=C-c a t=). (The variable
1775    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
1776    deadline items from your todo list).
1777 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
1778    item will still appear on your agenda two weeks from today, but it
1779    won't show up on your todo lists.
1780 ** Can I send myself an email containing tasks or other agenda info?
1781    :PROPERTIES:
1782    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
1783    :END:
1785    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
1787 ** How can I limit the agenda view to my "work" tasks?
1788    :PROPERTIES:
1789    :CUSTOM_ID: limit-agenda-with-tag-filtering
1790    :END:
1792    It is often convenient to group org files into separate categories,
1793    such as "home" and "work" (or "personal" and "professional"). One
1794    of the main reasons for such classification is to create agenda
1795    views that are limited by type of work or area of responsibility.
1796    For instance, while at work, one may want to see only professional
1797    tasks; while away from work, one may want to see only personal
1798    tasks.
1800    One way to categorize files and tasks is to use a "#+FILETAGS"
1801    declaration at the top of each file, such as:
1803    : #+FILETAGS: work
1805    As long as org-use-tag-inheritance is turned on, the filetags will
1806    be inherited by all tasks in the file. A file can have multiple
1807    filetags. And, of course, tags can be added to individual headings.
1809    Tasks can be quickly filtered by tag from within the agenda by
1810    typing "/" and the name of the tag. The full key sequence to filter
1811    for work items in an agenda view would be:
1813    : C-c a a / work [or a tag shortcut]
1815 ** How can I limit the agenda view to a particular category?
1816    :PROPERTIES:
1817    :CUSTOM_ID: limit-agenda-with-category-match
1818    :END:
1820    Another way to filter agenda views by type of work is to use a
1821    "#+CATEGORY" declaration at the top of each file, such as:
1823    : #+CATEGORY: work
1825    Categories can also be added to individual headings within a file:
1827    : * Big project
1828    :   :PROPERTIES:
1829    :   :CATEGORY: work
1830    :   :END:
1832    All todos belonging to the category "work" can be found a with a
1833    simple tags-todo search:
1835    : C-c a M
1837    At the prompt, type:
1839    : CATEGORY="work"
1841    The same results can be achieved with custom agenda commands, such as:
1843 #+BEGIN_SRC emacs-lisp
1844 (setq org-agenda-custom-commands
1845       '(("h" tags-todo "CATEGORY=\"home\"")
1846         ("w" tags-todo "CATEGORY=\"work\"")
1847         ;; other custom agenda commands here
1848         ))
1849 #+END_SRC
1851 ** How can include all org files in a directory in my agenda?
1852    :PROPERTIES:
1853    :CUSTOM_ID: set-agenda-files-using-wildcards
1854    :END:
1856 You can simply include the directory (as one of the items) in the
1857 value of the variable org-agenda-files:
1859 : (setq org-agenda-files '("/my/special/path/org/"))
1861 There is another way of accomplishing the same end:
1863 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
1865 ** Why aren't items disappearing from my agenda once they are marked done?
1866    :PROPERTIES:
1867    :CUSTOM_ID: removing-done-items-from-agenda
1868    :END:
1870 If items remain on your daily/weekly agenda after they are marked
1871 done, check the configuration of the following variables:
1873 : org-agenda-skip-scheduled-if-done
1874 : org-agenda-skip-deadline-if-done
1875 : org-agenda-skip-timestamp-if-done
1877 For instance, type:
1879 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
1881 If this variable is turned off (=nil=), then scheduled items will
1882 remain on the agenda even after they are marked done.
1884 If the variable is turned on (=t=), then scheduled items will
1885 disappear from the agenda after they are marked done.
1887 If these settings seem not to behave the way you expect, then make
1888 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
1889 difference between SCHEDULED, DEADLINE, and timestamps]].
1891 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
1892    :PROPERTIES:
1893    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
1894    :END:
1896 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
1897    the day they are scheduled and on every day thereafter until they
1898    are done. Schedule a task if you want to be reminded to do
1899    something beginning on a certain day and until it is done.
1901 : ** TODO Scheduled item
1902 :    SCHEDULED: <2009-03-01 Sun>
1904 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
1905    agenda in advance of the when they are due and remain on your
1906    agenda until they are done. Add a DEADLINE to an item if you want
1907    to make sure to complete it by a certain date. (The variable
1908    org-deadline-warning-days determines how far in advance items with
1909    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
1910    information.)
1912 : ** TODO Item with a deadline
1913 :    DEADLINE: <2009-01-20 Tue>
1915 3. An active timestamp (set with =C-c .=) will appear on your agenda
1916    only on the day it is scheduled. Use a timestamp for appointments
1917    or any reminders you want to show up only on a particular day.
1919 : ** TODO Item with an active timestamp
1920 : <2009-04-18 Sat>
1922 Note: items with inactive timestamps (set with C-c ! and marked by
1923 square brackets) will not show up in the agenda at all.
1925 ** Can I add files recursively to my list of agenda files?
1926    :PROPERTIES:
1927    :CUSTOM_ID: set-agenda-files-recursively
1928    :END:
1930 Yes, you can use the library "find-lisp."
1932 : (load-library "find-lisp")
1933 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
1935 This will add all files ending in =org= in the directory "~/org"
1936 and all of its subdirectories to your list of agenda files.
1938 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
1940 ** Why does an item appearing at the wrong time of day in my agenda?
1941    :PROPERTIES:
1942    :CUSTOM_ID: agenda-wrong-time-of-day
1943    :END:
1945 When preparing the agenda view, org-mode scans each relevant headline
1946 for a time designation. This approach is very nice for adding
1947 free-form timestamps to an item for scheduling. Thus, either of the
1948 following work would work to schedule an item at 10:00am:
1950 #+begin_src org
1951 ,** 10:00am Get dried ice at the magic store
1952 ,   SCHEDULED: <2009-05-27 Wed>
1953 #+end_src
1955 #+begin_src org
1956 ,** Get dried ice at the magic store
1957 ,   SCHEDULED: <2009-05-27 Wed 10:00>
1958 #+end_src
1960 To enable this flexibility, org-mode scans the entire headline for
1961 time of day notation. A potential problem can arise if you use
1962 inactive timestamps in the headline to note when an item was created.
1963 For example,
1965 #+begin_src org
1966 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
1967 ,   SCHEDULED: <2009-05-27 Wed>
1968 #+end_src
1970 Org mode would interpret the time in the inactive timestamp as a
1971 time-of-day indicator and the entry would appear in your agenda at
1972 12:58.
1974 If you would like to turn off the time-of-day search, you can
1975 configure the variable =org-agenda-search-headline-for-time= (requires
1976 org-mode >= 6.24).
1978 * Appointments/Diary
1979   :PROPERTIES:
1980   :CUSTOM_ID: Appointments/Diary
1981   :END:
1982 ** Is it possible to include entries from org-mode files into my emacs diary?
1983    :PROPERTIES:
1984    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
1985    :END:
1987    Since the org-mode agenda is much more powerful and can contain the
1988    diary, you should think twice before deciding to do this.  If you
1989    insist, however, integrating Org-mode information into the diary is
1990    possible.  You need to turn on /fancy diary display/ by setting in
1991    .emacs:
1993    : (add-hook 'diary-display-hook 'diary-fancy-display)
1995    Then include the following line into your ~/diary file, in
1996    order to get the entries from all files listed in the variable
1997    =org-agenda-files=
1999    : &%%(org-diary)
2001    You may also select specific files with
2003    : &%%(org-diary) ~/path/to/some/org-file.org
2004    : &%%(org-diary) ~/path/to/another/org-file.org
2006    If you now launch the calendar and press @<tt>d@</tt> to display a
2007    diary, the headlines of entries containing a timestamp, date range,
2008    schedule, or deadline referring to the selected date will be listed.
2009    Just like Org-mode's agenda view, the diary for /today/ contains
2010    additional entries for overdue deadlines and scheduled items.  See
2011    also the documentation of the =org-diary= function.  Under XEmacs, it
2012    is not possible to jump back from the diary to the org, this works
2013    only in the agenda buffer.
2014 ** I want to add my Org scheduled/deadlined entries in my diary!
2015    :PROPERTIES:
2016    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2017    :END:
2019   Put this in your ~/.diary:
2021   : &%%(org-diary :scheduled :timestamp :deadline)
2023 ** How can I set up automatic reminders based on Org information?
2024    :PROPERTIES:
2025    :CUSTOM_ID: automatic-reminders
2026    :END:
2028   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2029 ** How can I make =appt= notice my Org appointments?
2030    :PROPERTIES:
2031    :CUSTOM_ID: appt-notice-my-Org-appointments
2032    :END:
2034   : M-x org-agenda-to-appt RET
2036 ** How can I create more complex appointments in my org-files?
2037    :PROPERTIES:
2038    :CUSTOM_ID: diary-sexp-in-org-files
2039    :END:
2041 Org-mode's active timestamps work very well for scheduling individual
2042 or recurring appointments, such as:
2044 #+begin_src org
2045   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2046 #+end_src
2049 #+begin_src org
2050   ,* Vacation
2051   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2052 #+end_src
2056 #+begin_src org
2057   ,* Weekly meeting with boss
2058   ,  <2009-01-20 Tue 14:00 +1w>
2059 #+end_src
2061 Sometimes, however, you need to set up more complicated recurring
2062 appointments. Org-mode has built-in support for many of
2063 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2064 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
2065 instance, that you teach a class that meets every Monday evening
2066 between February 16 and April 20, 2009. The way to enter this an
2067 org-mode file is:
2069 #+begin_src org
2070   ,** Class 7:00pm-9:00pm
2071   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2072 #+end_src
2074 The expression above designates all Mondays that fall between February
2075 16 and April 20. How exactly does it work?
2077  - (and... :: Indicates that *both* of the conditions that follow have
2078           to be true.
2080    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2081         Monday?
2083        - Note: the function calendar-day-of-week converts the date to the day of week
2084          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2086    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2087         these two dates?
2089 You can make a sexp as complex as you like. If you wanted to omit a
2090 week because of holidays, for instance, you could add another
2091 condition to the sexp:
2093 #+begin_src org
2094   ,** Class 7:00pm-9:00pm
2095   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2096 #+end_src
2098 The sexp above would omit Monday during the week of March 9, 2009. For
2099 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2101 Another diary function commonly used for more complex scheduling is
2102 diary-float. For instance,
2104 #+begin_src org
2105   ,* Monthly meeting
2106   ,  <%%(diary-float t 3 3)>
2107 #+end_src
2109 ...would appear on the third Wednesday of every month.
2111 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2112 page on the Emacs wiki]].
2114 ** How can I schedule a weekly class that lasts for a limited period of time?
2115    :PROPERTIES:
2116    :CUSTOM_ID: org-diary-class
2117    :END:
2119 Org-mode offers a convenient diary sexp function for setting up a
2120 recurring appointment that lasts for a certain period of time, such as
2121 a class. It is called org-diary-class and it can be entered as
2122 follows:
2124 #+begin_src org
2125   ,** Class 7:00pm-9:00pm
2126   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2127 #+end_src
2129 The function above schedules an appointment for every Monday (1)
2130 between February 16 and April 20, 2009, except for ISO week 10 (March
2131 1 to March 7).
2133 The function org-diary-class has the following format:
2135 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2137 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2138 takes the form of a number indicating the day of the week (0 = Sunday,
2139 1 = Monday, and so on...). In addition, one can add an optional
2140 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2141 skipped. This argument should be expressed as an ISO week number. You
2142 can find the number by invoking emacs' built-in calendar (=M-x
2143 calendar=), navigating to the appropriate week, and typing =p c=
2144 (calendar-iso-print-date).
2146 ** How can I set an event to occur every day except Saturday and Sunday?
2148    #+begin_example
2149    ** Daily meeting
2150       <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2151    #+end_example
2153 * Export
2154   :PROPERTIES:
2155   :CUSTOM_ID: Export
2156   :END:
2157 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2158    :PROPERTIES:
2159    :CUSTOM_ID: export-TODO-items-as-lists
2160    :END:
2162    If you plan to use ASCII or HTML export, make sure things you want to
2163    be exported as item lists are level 4 at least, even if that does
2164    mean there is a level jump.  For example:
2166    : * Todays top priorities
2167    : **** TODO write a letter to xyz
2168    : **** TODO Finish the paper
2169    : **** Pick up kids at the school
2171    Alternatively, if you need a specific value for the heading/item
2172    transition in a particular file, use the =#+OPTIONS= line to
2173    configure the H switch.
2175    : #+OPTIONS:   H:2; ...
2177 ** Can I export only a single subtree?
2178    :PROPERTIES:
2179    :CUSTOM_ID: export-single-subtree
2180    :END:
2182    If you want to export a subtree, mark the subtree as region and then
2183    export.  Marking can be done with =C-c @ C-x C-x=, for example.
2185 ** How can I tell my calendar web application about appointments in my agenda files?
2187 Here is what you need to do:
2189 1. a script that calls Emacs in batch mode and produce a .ics file
2190 2. a script that uploads this .ics file somewhere on the web
2191 3. tell your webapp to fetch this .ics file on the web
2193 Here is the script I use for the first step:
2195 #+begin_src shell-script-mode
2196 #!/bin/bash
2198 /usr/local/bin/emacs --batch --eval \
2199 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2200         (load-file \"~/elisp/config/org-batch-config.el\") \
2201         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2202         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2203     -f org-export-icalendar-combine-agenda-files
2204 #+end_src
2206 Depending on your configuration, you might change the load sequence.
2208 Here is the script I use for the second step:
2210 #+begin_src shell-script-mode
2211 #!/bin/bash
2212 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2213 #+end_src
2215 Note: if you want to cron this rsync script, you will need to let
2216 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2217 starter.
2219 Now you can cron the two scripts above and your webapp will always be
2220 up to date with your Org agendas.
2222 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2224 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2225    :PROPERTIES:
2226    :CUSTOM_ID: iCal-import-ics-files-old
2227    :END:
2229    When using iCal under Apple MacOS X Tiger, you can create a new
2230    calendar /OrgMode/ (the default name for the calendar created by =C-c
2231    C-e c=, see the variables =org-icalendar-combined-name= and
2232    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2233    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2234    You may even use AppleScript to make iCal re-read the calendar files
2235    each time a new version of /OrgMode.ics/ is produced.  Here is the
2236    setup needed for this:
2238    : (setq org-combined-agenda-icalendar-file
2239    :     "~/Library/Calendars/OrgMode.ics")
2240    : (add-hook 'org-after-save-iCalendar-file-hook
2241    :  (lambda ()
2242    :   (shell-command
2243    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2245 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2246    :PROPERTIES:
2247    :CUSTOM_ID: iCal-import-ics-files-new
2248    :END:
2250    For Mac OS X 10.4, you need to write the ics file to
2251    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2252    =http: //localhost/orgmode.ics=
2254 ** How can I remove timestamps and todo keywords from my exported file?
2255    :PROPERTIES:
2256    :CUSTOM_ID: export-options-remove-timestamps
2257    :END:
2259 You can place an options line at the top of your org file:
2261 : #+OPTIONS: <:nil todo:nil
2263 There is a whole host of export options you can set with an in-buffer
2264 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2265 full list.
2267 ** How can I preserve faces when I export an agenda from the command line?
2268    :PROPERTIES:
2269    :CUSTOM_ID: preserving-faces-during-batch-export
2270    :END:
2272 Normally, when you export an org file or an agenda view from within
2273 emacs, htmlize will convert your face definitions to direct color css
2274 styles inlined into each =<span>= object, resulting in an HTML output
2275 that preserves the general look of your Org buffers and agenda views.
2277 Let's say you generate an export from the command line, such as the
2278 following:
2280 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2284 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2286 In such an instance, the exported HTML will contain only very basic
2287 color styles. The reason is that when Emacs is run in batch mode, it
2288 does not have a display and therefore only rudimentary face
2289 definitions.  If you'd like to use more complex styles, you'll have to
2290 make sure that the export process only assigns classes instead of
2291 direct color values.  This can be done by binding the variable
2292 =org-export-htmlize-output-style= to =css= for the duration of the
2293 export, for example with
2295 : emacs -batch -l ~/.emacs
2296 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
2297 :            (org-batch-agenda "e"))'
2299 Then you can use a style file to make these classes look any way you
2300 like.  To generate face definitions for a CSS file based on any faces
2301 you are currently using in Emacs, you can use the following command:
2303 : M-x org-export-htmlize-generate-css RET
2305 This will generate a =<style>...</style>= section, the content of
2306 which you can add to your style file.
2308 ** How can I avoid dark color background when exporting agenda to ps format?
2309    :PROPERTIES:
2310    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2311    :END:
2313 Add this to your .emacs and evaluate it.
2315 #+BEGIN_SRC emacs-lisp
2316   (setq org-agenda-exporter-settings
2317         '((ps-print-color-p 'black-white)))
2318 #+END_SRC
2320 ** How can I get colored source code when exporting to LaTeX?
2321    :PROPERTIES:
2322    :CUSTOM_ID: fontified_source_code_w_latex
2323    :END:
2325 As of Sun Aug 9 2009 the "current" version of Org-mode (see
2326 [[keeping-current-with-Org-mode-development]]) supports exporting source
2327 code to LaTeX using the listings package.
2329 To turn on listing export add the following to your Org-mode
2330 customization.
2331 #+begin_src emacs-lisp
2332   ;; requite org-latex so that the following variables are defined
2333   (require 'org-latex)
2334   
2335   ;; tell org to use listings
2336   (setq org-export-latex-listings t)
2337   
2338   ;; you must include the listings package
2339   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
2340   
2341   ;; if you want colored source code then you need to include the color package
2342   (add-to-list 'org-export-latex-packages-alist '("" "color"))
2343 #+end_src
2345 The listings package will now be used to fontify source code in your
2346 LaTeX documents.  By default listings will not color any of your
2347 source code.  If you would like to set colors for keywords and
2348 comments in your latex documents you can do so using LaTeX directives
2349 like the following.
2350 #+begin_src latex
2351   \lstset{keywordstyle=\color{blue},
2352     commentstyle=\color{red},
2353     stringstyle=\color{green}
2354   }
2355 #+end_src
2357 of if you want to get even fancier with your colors you can try
2358 something like the following
2359 #+begin_src latex
2360 \definecolor{keywords}{RGB}{255,0,90}
2361 \definecolor{comments}{RGB}{60,179,113}
2362 \definecolor{fore}{RGB}{249,242,215}
2363 \definecolor{back}{RGB}{51,51,51}
2364 \lstset{
2365   basicstyle=\color{fore},
2366   keywordstyle=\color{keywords},  
2367   commentstyle=\color{comments},
2368   backgroundcolor=\color{back}
2370 #+end_src
2372 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
2374 ** How can I export to Latex Beamer
2375    :PROPERTIES:
2376    :CUSTOM_ID: beamer
2377    :END:
2378 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
2379 The following can be used to export Org-mode documents to LaTeX
2380 beamer.
2382 Add the following to your Emacs initialization file.
2383 #+begin_src emacs-lisp
2384   (unless (boundp 'org-export-latex-classes)
2385     (setq org-export-latex-classes nil))
2386   (add-to-list 'org-export-latex-classes
2387                '("beamer"
2388                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
2389                  ("\\section{%s}" . "\\section*{%s}")
2390                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
2391                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
2392 #+end_src
2394 Then by placing
2395 : #+LaTeX_CLASS: beamer
2396 in the header of your Org-mode document it will automatically export
2397 to the Beamer document class on LaTeX export.  With the above
2398 configuration top-level headers will be mapped to sections in the
2399 Beamer document, second-level headers will be mapped to frames, and
2400 lower level headlines will be mapped to itemize objects.
2402 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
2403 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
2404 Thomas Dye]].
2406 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
2408 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
2409 aids in creation of bibliographies, cross-references, indexes, and
2410 glossaries.  RefTeX understands the structure of multi-file LaTeX
2411 documents and is able to collect from them information about the
2412 location(s) of external data stores used in creation of the final
2413 document.  RefTeX was written by Carsten Dominik and is currently
2414 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
2416 *** Using RefTeX In Org-mode Files for LaTeX Export
2417 In Org-mode files for LaTeX export, the trick is to find a way to tell
2418 RefTeX the locations of external data stores.  One way is to set the
2419 variable, =reftex-default-bibliography=.  Add lines like these to
2420 .emacs:
2422 #+begin_src emacs-lisp 
2423   (setq reftex-default-bibliography
2424         (quote
2425          ("default.bib" "other-default.bib")))       
2426 #+end_src
2428 In practice, this is a limited solution and the
2429 typical user will want to pass this information on a per-file basis.
2430 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
2431 Braindump]].  
2433 The first solution, proposed by Mario, enables the RefTeX citation
2434 function in Org-mode.  Add these lines to .emacs:
2436 #+begin_src emacs-lisp
2437   (defun org-mode-reftex-setup ()
2438     (load-library "reftex")
2439     (and (buffer-file-name)
2440          (file-exists-p (buffer-file-name))
2441          (reftex-parse-all))
2442     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
2443   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
2444 #+end_src
2446 Then add the following lines anywhere in the Org-mode file (Org-mode
2447 will recognize them as LaTeX commands):
2449 #+begin_src org
2450 \bibliographystyle{plain}
2451 \bibliography{BIB-NAME}
2452 #+end_src
2454 With this setup, =C-c )= will invoke =reftex-citation= which will
2455 insert a reference in the usual way:
2457 #+begin_src org
2458 * test reftex
2460 This is a citation \cite{tierney90}.
2462 \bibliographystyle{plain}
2463 \bibliography{tsd}
2464 #+end_src
2466 This Org-mode file will export the following LaTeX output:
2468 #+begin_src latex :exports code
2469   % Created 2010-03-22 Mon 14:34
2470   \documentclass[11pt,letter]{article}
2471   \usepackage[utf8]{inputenc}
2472   \usepackage[T1]{fontenc}
2473   \usepackage{hyperref}
2474   
2475   \title{test.org}
2476   \author{Tom Dye}
2477   \date{2010-03-22 Mon}
2478   
2479   \begin{document}
2480   
2481   \maketitle
2482   
2483   \setcounter{tocdepth}{3}
2484   \tableofcontents
2485   \vspace*{1cm}
2486   
2487   \section{test reftex}
2488   \label{sec-1}
2489   
2490   
2491   This is a citation \cite{tierney90}.
2492   
2493   \bibliographystyle{plain}
2494   \bibliography{tsd}
2495   
2496   \end{document}
2497 #+end_src
2500 A second solution, to activate the RefTeX minor mode on a per-file
2501 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
2502 Add the following lines to .emacs:
2504 #+begin_src emacs-lisp
2505   (add-hook ‘org-mode-hook
2506              (lambda ()
2507                (if (member “WRITE” org-todo-keywords-1)
2508                    (org-mode-article-modes))))
2509 #+end_src
2511 where =org-mode-article-modes= is defined as follows:
2513 #+begin_src emacs-lisp
2514   (defun org-mode-article-modes ()
2515     (reftex-mode t)
2516     (bib-cite-minor-mode t)
2517     (and (buffer-file-name)
2518          (file-exists-p (buffer-file-name))
2519          (reftex-parse-all)))
2520 #+end_src
2522 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
2523 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
2524 like this:
2526 #+begin_src org
2527   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
2528 #+end_src
2530 With this setup, you insert a citation with =M-x reftex-citation RET=.
2532 *** Using RefTeX in Org-babel LaTeX Code Blocks
2534 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
2535 information in other Org-babel LaTeX code blocks.  If you use an Emacs
2536 starter kit where configuration information is held in Org-mode files,
2537 then the second solution is preferable because you won't be asked for
2538 a master file when Emacs is started.  For this reason, the second
2539 solution is modified for use with Org-babel latex code blocks.  No
2540 key-binding is needed here because Org-babel code blocks are edited
2541 within the usual AucTeX environment.
2543 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]])
2544 #+begin_src emacs-lisp
2545   (defun org-mode-article-modes ()
2546     (reftex-mode t)
2547     (and (buffer-file-name)
2548          (file-exists-p (buffer-file-name))
2549          (reftex-parse-all)))
2550   
2551   (add-hook 'org-mode-hook
2552             (lambda ()
2553               (if (member "REFTEX" org-todo-keywords-1)
2554                   (org-mode-article-modes))))
2555 #+end_src
2557 Then add a line like the following line to the top of your org-mode file:
2559 #+begin_src org
2560   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
2561 #+end_src
2563 When you open an org-mode file with a line like this, RefTeX will
2564 prompt for the master .tex file, which will be parsed in the usual
2565 way.  This means that the .tex file should already exist, perhaps by
2566 tangling the LaTeX preamble and postamble, before
2567 =org-mode-article-modes= is activated for the Org-mode file.
2569 * COMMENT HTML style specifications
2571 #+begin_src emacs-lisp
2572   (defun org-faq-make-target ()
2573     "Make hard target for current headline."
2574     (interactive)
2575     (if (not (org-on-heading-p))
2576         (error "Not on a headline"))
2577     (let ((h (org-trim (org-get-heading 'no-tags))))
2578       (if (string-match "[ \t]*\\?\\'" h)
2579           (setq h (replace-match "" t t h)))
2580       (while (string-match "[ \t]+" h)
2581         (setq h (replace-match "-" t t h)))
2582       (org-entry-put nil "CUSTOM_ID" h)))
2583 #+end_src