update issue file.
[Worg.git] / org-faq.org
blobfd9f7ab9ef882623b889e2bb2c028ef1358cf229
1 #+STARTUP:   overview
2 #+OPTIONS:   H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t
3 #+EMAIL:     carsten.dominik@gmail.com
4 #+AUTHOR:    Worg people
5 #+LANGUAGE:  en
6 #+TITLE:     Org-mode Frequently Asked Questions
7 #+INFOJS_OPT: view:content toc:1 path:http://orgmode.org/worg/code/org-info-js/org-info.js tdepth:1 ftoc:t buttons:0 mouse:underline
8 #+OPTIONS:   H:3 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
10 #+begin_html
11 <a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
12 #+end_html
14 [[file:index.org][{Back to Worg's index}]]
16 * Welcome
17   :PROPERTIES:
18   :CUSTOM_ID: Welcome
19   :END:
21 Welcome to the Org-mode FAQ.
23 You can navigate the FAQ by clicking on any of the topics in the Table
24 of Contents.
26 If your browser supports JavaScript, you can...
28 - move through the topics by typing "=n=" (next) and "=p=" (previous).
30 - see an outline view of the FAQ by typing "=m=" or clicking "=toggle
31   view=" (above).
33 - search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
35 - see a full list of navigation commands by typing "=?=" or clicking
36   "=Help=" (above).
38 * What is org-mode?
39   :PROPERTIES:
40   :CUSTOM_ID: What-is-org-mode
41   :END:
42 ** Can I implement a GTD workflow with Org-mode?
43    :PROPERTIES:
44    :CUSTOM_ID: GTD-workflow-with-Org-mode
45    :END:
47    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.php][here]].
49 ** What is the difference between Org and TaskPaper?
50    :PROPERTIES:
51    :CUSTOM_ID: Org-and-TaskPaper
52    :END:
54   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
55   is just that, when using Org within Emacs, it lets you do many things
56   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
57   fiddle-proof and people using Emacs tends to like fiddling (which is
58   orthogonal to the idea of using todo-list efficiently), but this is
59   just a matter of discipline and common sense, not one of Org's design.
61   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
62 ** What is the meaning of the Unicorn on Org's website?
63    :PROPERTIES:
64    :CUSTOM_ID: unicorn
65    :END:
67 The Unicorn is the logo of Org-mode because:
69 - Org-mode is the UNICs of ORgaNizers.
71 - Org-mode is an Emacs mode, so it makes sense to use an animal
72   similar or related to the gnu used for GNU Emacs.
74 - Org-mode is meant to show you the way, and an animal with two horns
75   can not do this very well, can it?
77 - Unicorn tears are said to reverse petrification, and wasn't this how
78   we all felt before getting to some degree of time and task
79   management?
81 - It will take forever to learn everything there is to know about a
82   unicorn.
84 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
85   creation.
87 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
88 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
89 gave it a refresh some time later.  Bastien writes why he chose a
90 unicorn:
92 #+BEGIN_QUOTE
93 The first reason is not linked to the animal, but to the sounding of the
94 word "Unicorn" - because Org gives you a /uni/que way of producing files
95 in several format (HTML, LaTeX, etc.)
97 The second reason is that a Unicorn doesn't really exist, it is just
98 something you can dream about, and make others believe it does exist.
99 Just like the perfect organizer.
100 #+END_QUOTE
102 There was a [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][thread about unicorns]] on the mailing list.  [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][Christopher
103 Suckling]] posted a link showing how to make a simple foldable unicorn
104 (very appropriate for an outlining program!).
106 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
107 possession of the Org-mode author.
109 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
110   This logo is available in a number of different formats including
111   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
113 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
115 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[http://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
117 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][Stefan Vollmar]] made a [[http://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[http://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
118   threshold technique".
120 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
121   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
123 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
125 * Mailing list
126 ** Why hasn't my email to the mailing list shown up yet?
127    :PROPERTIES:
128    :CUSTOM_ID: ml-post-delay
129    :END:
131 The org-mode mailing list is moderated. Thus, if you are not
132 subscribed to the mailing list, your mail will only appear on the list
133 after it has been approved by a moderator. To ensure that your mail
134 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
136 ** I read the mailing list through gmane. Should I subscribe?
137    :PROPERTIES:
138    :CUSTOM_ID: ml-subscription-and-gmane
139    :END:
141 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
142 participants in the list prefer read the list in a newsreader, such as
143 Gnus, instead of receiving emails. If you choose to read the list via
144 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
145 any emails on the mailman settings page (see the "Mail Delivery"
146 setting).
148 This will ensure that your messages to the list get through quickly,
149 reduce the work load of the mailing list moderators (who need to clear
150 every mail from non-members), and provide more accurate information
151 about the number of list readers.
153 * Keeping current
154   :PROPERTIES:
155   :CUSTOM_ID: Keeping-current
156   :END:
157 ** How do I keep current with Org mode development?
158    :PROPERTIES:
159    :CUSTOM_ID: keeping-current-with-Org-mode-development
160    :END:
162    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]].  You can keep up-to-date with Org
163    mode developement by cloning Org mode repository and refreshing
164    your copy with latest changes whenever you wish.  You only need to
165    use two Git commands (clone and pull.)  Here are the steps in
166    brief (please customize locations to suit your setup):
168    1. Select a location to house the Org mode repository (approx. 40
169       MB; includes documentation, compiled elisp files and history
170       going all the way back to v4.12a)
172       : $ mkdir $HOME/elisp && cd $HOME/elisp
174    2. Clone the Org mode Git repository.
176       Recommended approach:
178       : $ git clone git://repo.or.cz/org-mode.git
180       Alternate approach if you are behind a firewall that allows only
181       HTTP (can be quite slow):
183       : $ git clone http://repo.or.cz/r/org-mode.git
185    3. Compile and install Org mode and build documentation.
187       : $ cd org-mode && make && make doc && make install
189       Please note that you can choose to /not/ compile at all and run
190       using source =.el= files only.  Compiled files speed things up.
192    4. This is where you configure Org mode with Emacs.  Please refer
193       to [[./org-tutorials/index.org][Org tutorials]].
195    5. Keeping up-to-date.
197       Cloning the repository is a one time activity.  From this point
198       onwards you only need to /pull/ the latest changes.
200       : $ cd $HOME/elisp/org-mode
202       and then
204       : $ git pull && make clean && make && make doc && make install
206    6. You should restart org mode to have the changes take effect (if
207       you are not rebooting Emacs.)  Also since the intention is to
208       "keep up" with Org mode, you should visit 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:
374 ** How can I quickly browse all Org options?
376 =M-x org-customize RET=
378 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
379 for details.
381 ** Can I use the editing features of org-mode in other modes?
382    :PROPERTIES:
383    :CUSTOM_ID: use-editing-features-in-other-modes
384    :END:
386    Not really---but there are a few editing features you can use in
387    other modes.
389    - For tables there is =orgtbl-mode= which implements the table
390      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
391    - For ordered lists there is =orgstuct-mode= which allows for easy
392      list editing as a minor mode. (To enable, type =M-x
393      orgstruct-mode=)
395    You can activate these modes automatically by using hooks:
397    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
398    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
400    For footnotes, there is the function =org-footnote-action=, which
401    works in non-org buffers. This function is a powerful tool for
402    creating and sorting footnotes. To use it globally, you can add the
403    following keybinding to your =.emacs= file (requires Org 6.17 or
404    greater):
406    : (global-set-key (kbd "C-c f") 'org-footnote-action)
408    For other features you need to switch to Org-mode temporarily, or
409    prepare text in a different buffer.
411 ** Why isn't feature "X" working the way it is described in the manual?
412    :PROPERTIES:
413    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
414    :END:
416 Org-mode develops very quickly. If you are using a version of org-mode
417 that shipped with emacs, there is a good chance that it is somewhat
418 out of date.
420 Many of the users on the org-mode mailing list are using either a
421 recent release of org-mode or the
422 [[http://orgmode.org/index.html#sec-3.2][development version of
423 org-mode from the git repository]].
425 If some settings and features aren't working the way you expect, make
426 sure that the version of the manual you are consulting matches the
427 version of org-mode you are using.
429    - You can check which version of org-mode you are using by
430      selection =Org --> Documentation --> Show Version= in the Emacs
431      menu.
433    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
434      release.
436    - 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
437      released with the latest official Gnu Emacs release. Compared
438      with the manual at the orgmode.org, the manual at www.gnu.org is
439      somewhat out of date.
441 For instructions on how to stay current with org-mode, consult
442 [[keeping-current-with-Org-mode-development][this FAQ]] or follow the
443 instructions on [[http://orgmode.org][the official org-mode site]].
445 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
446    :PROPERTIES:
447    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
448    :END:
450    Yes, these functions are written in a way that they are independent of
451    the outline setup.  The following setup provides standard Org-mode
452    functionality in outline-mode on =TAB= and =S-TAB=.  For
453    outline-minor-mode, we use =C-TAB= instead of =TAB=,
454    because =TAB= usually has mode-specific tasks.
456 #+BEGIN_SRC emacs-lisp
457 (add-hook 'outline-minor-mode-hook
458   (lambda ()
459     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
460     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
461 (add-hook 'outline-mode-hook
462   (lambda ()
463     (define-key outline-mode-map [(tab)] 'org-cycle)
464     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
465 #+END_SRC
467 Or check out /outline-magic.el/, which does this and also provides
468 promotion and demotion functionality.  /outline-magic.el/ is
469 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
471 ** Can I save/restore the visibility state of an org-mode buffer?
473 Well, no.
475 ** How can I keep track of changes in my Org files?
476    :PROPERTIES:
477    :CUSTOM_ID: track-of-changes-in-Org-files
478    :END:
480   Use git to track the history of the files, use a cronjob to check in
481   changes regularly.  Such a setup is described by Bernt Hansen
482   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
484 ** Can I use Org-mode as the default mode for all README files?
485    :PROPERTIES:
486    :CUSTOM_ID: Org-mode-as-default-mode
487    :END:
489 Add the following to your .emacs file:
491 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
493 You can even make it the default mode for any files with unspecified
494 mode using
496 : (setq default-major-mode 'org-mode)
498 ** Can I use ido.el for completing stuff in Org?
499    :PROPERTIES:
500    :CUSTOM_ID: ido-complete
501    :END:
503    Yes, you can.  If you are an ido user and ido-mode is active, the
504    following setting will make Org use =ido-completing-read= for most
505    of its completing prompts.
507 : (setq org-completion-use-ido t)
509 ** Should I use one big org file or multiple files?
510    :PROPERTIES:
511    :CUSTOM_ID: how-to-organize-org-mode-files
512    :END:
514 Org-mode is flexible enough to accomodate a variety of organizational
515 and time management schemes. Org's
516 [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline
517 cycling and convenient editing and navigation commands]] make it
518 possible to maintain all of your projects and notes in a single file.
519 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
520 notes and todos]], also make it a delight to maintain a private "wiki"
521 consisting of multiple files.
523 No matter how you organize your org files, org-mode's agenda commands
524 make it easy to search all your notes and gather together crucial data
525 in a single view.
527 Moreover, several org-mode settings can be configured either globally
528 in your =.emacs= file or locally (per file or per outline tree). See
529 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
530 see [[limit-agenda-with-category-match][this FAQ]].
532 Here are a few ideas for organizing org-mode files:
534 - A single file for all your projects and notes.
535 - One file per project.
536 - One file per client.
537 - One file per area of responsibility or type of work (e.g.,
538   household, health, work, etc.).
539 - One file for projects, one for appointments, one for reference
540   material, one for someday/maybe items, etc.
541 - A wiki of hyperlinked files that grows and adapts to meet your
542   needs.
544 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
545 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
547 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
548    :PROPERTIES:
549    :CUSTOM_ID: setting-global-keybindings
550    :END:
552 Org-mode has a few global keybindings that the user must set
553 explicitly in an =.emacs= file. These keybindings include the
554 customary shortcut for calling the agenda (=C-c a=). If nothing
555 happens when you type =C-c a=, then make sure that the following lines
556 are in your =.emacs= file:
558 #+BEGIN_SRC emacs-lisp
559 ;; The following lines are always needed.  Choose your own keys.
560 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
561 (global-set-key "\C-cl" 'org-store-link)
562 (global-set-key "\C-ca" 'org-agenda)
563 (global-set-key "\C-cb" 'org-iswitchb)
564 #+END_SRC emacs-lisp
566 You may, of course, choose whatever keybindings work best for you
567 and do not conflict with other modes.
569 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
570 questions.
572 ** Why aren't some of the variables I've customized having an effect?
573    :PROPERTIES:
574    :CUSTOM_ID: load-org-after-setting-variables
575    :END:
577 Some org variables have to be set before org.el is loaded or else they
578 will not work. (An example is the new variable
579 =org-enforce-todo-dependencies=.)
581 To make sure all your variables work you should not use =(require
582 'org)=. Instead use the following setting:
584 : (require 'org-install)
586 You should also make sure that you do not require any other =org-...=
587 files in your =.emacs= file before you have set your org variables,
588 since these will also cause org.el to be loaded. To be safe, load org
589 files *after* you have set your variables.
591 ** How can I make sure that timestamps appear in English?
592    :PROPERTIES:
593    :CUSTOM_ID: timestamps-and-system-time-locale
594    :END:
596 If your system's locale is not set to English, but you would like the
597 timestamps in your org-mode files to appear in English, you can set
598 the following variable:
600 #+begin_src emacs-lisp
601   (setq system-time-locale "C")
602 #+end_src
604 ** What does a minimal .emacs look like?
605 Using a stripped down minimal .emacs files removes broken custom
606 settings as the cause of an issue and makes it easy to reproduce for
607 other people.  The example below has system-specific paths that you'll
608 need to change for your own use.
609 #+begin_src emacs-lisp
610   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
611   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
612   (setq org-agenda-files '("/tmp/test.org"))
613   (require 'org-install)
614   (require 'org-habit)
615   
616   (global-set-key "\C-cl" 'org-store-link)
617   (global-set-key "\C-ca" 'org-agenda)
618   (global-set-key "\C-cb" 'org-iswitchb)
619 #+end_src
621 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
622 configuration code to it, then start emacs something like this:
623 #+begin_src sh
624   emacs -Q -l ~/minimal.emacs
625 #+end_src
627 On OS X, starting emacs with minimal configuration might look
628 something like this:
629 #+begin_src sh 
630   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
631 #+end_src sh
632 * Errors and general problems
633   :PROPERTIES:
634   :CUSTOM_ID: Errors
635   :END:
636 ** Opening Org files in Emacs leads to a crash
637    :PROPERTIES:
638    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
639    :END:
640    The only known case where Org-mode can crash Emacs is when you are
641    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
642    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
643    problem should go away.
645 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
646    :PROPERTIES:
647    :CUSTOM_ID: wrong-type-argument-keymapp
648    :END:
650    This is a conflict with an outdated version of the /allout.el/, see
651    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
653 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html.... 
654    :PROPERTIES:
655    :CUSTOM_ID: external-application-launched-to-open-file-link
656    :END:
658 If you want special control about how Org-mode opens files, see the
659 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
660 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
662 *However*, normally it is best to just use the mechanism the
663 operating-system provides:
665 *** GNU/Linux systems
666     You you have to check your mailcap settings, find the files:
668     : /etc/mailcap
669     : 
670     : or  
671     : 
672     : $HOME/.mailcap
674 and modify them accordingly. Please read their manual entry.
676 *** Windows systems 
677     + for html pages you may configure the =browse-url-= variables through
678       the Customize interface,
679     + the pdf files are automatically opened with Acrobat Reader (if it is
680       installed)
682 *** Mac OSX
683     Change the application responsible for this file type by selecting
684     such a file in the Finder, select =File->Get Info= from the menu
685     and select the application to open this file with.  Then, to
686     propagate the change to all files with the same extension, select
687     the =Change all= button.
689 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
690    :PROPERTIES:
691    :CUSTOM_ID: YASnippet
692    :END:
694 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
695 inspired by TextMate's templating syntax.
696 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
697 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
699 *Note*: yasnippet is not compatible with =org-indent-mode= currently
700 there is no known way to use both successfully with =yas/trigger-key=
701 set to =TAB= (or =[tab]= etc...)
703 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
704 =\t=) overrules yasnippets' access to this key.  The following code
705 fixes this problem:
707 #+begin_src emacs-lisp
708 (add-hook 'org-mode-hook
709           (lambda ()
710             (org-set-local 'yas/trigger-key [tab])
711             (define-key yas/keymap [tab] 'yas/next-field-group)))
712 #+end_src
714 If the above code doesn't work (which it may not with later versions
715 of yasnippet).  Then try the following
717 #+begin_src emacs-lisp
718   (defun yas/org-very-safe-expand ()
719     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
720   
721   (add-hook 'org-mode-hook
722             (lambda ()
723               ;; yasnippet (using the new org-cycle hooks)
724               (make-variable-buffer-local 'yas/trigger-key)
725               (setq yas/trigger-key [tab])
726               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
727               (define-key yas/keymap [tab] 'yas/next-field)))
728 #+end_src
730 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]])
731 with YASnippets for Org-mode.
733 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
734    :PROPERTIES:
735    :CUSTOM_ID: CUA-mode
736    :END:
738 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
740 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
741    :PROPERTIES:
742    :CUSTOM_ID: windmove.el
743    :END:
745 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
747 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
748    :PROPERTIES:
749    :CUSTOM_ID: loaded-old-org
750    :END:
752 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=.
754 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.
756 You should add your directories to the =load-path= at the beginning:
758 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
760 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)=.
762 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.
764 ** Why doesn't org-batch-agenda work under Win32?
765    :PROPERTIES:
766    :CUSTOM_ID: org-batch-agenda-under-win32
767    :END:
769 When I run the example batch files to print my agenda to the console
770 under Win32 I get the failure:
772 : End of file during parsing
774 and no agenda is printed.
776 The problem is the use of single quotes surrounding the eval in the
777 emacs command-line. This gets confused under Win32. All string
778 parameters with spaces must be surrounded in double quotes. This means
779 that double quotes being passed to the eval must be escaped.
781 Therefore, instead of the following:
783 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
784 :     -eval '(org-batch-agenda "a")'
786 you need to use the following:
788 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
789 :     -eval "(org-batch-agenda \"a\")"
791 (all on one line, of course).
793 ** Org agenda seems very slow
794    :PROPERTIES:
795    :CUSTOM_ID: slow-agenda
796    :END:
798 If it takes a long time to generate or refresh the agenda, you might
799 want first check which version of org-mode you are using. There have
800 been major optimizations of org-agenda since 6.21b, which was the
801 version of org-mode released with Emacs 23. If you are using 6.21b or
802 earlier (you can check with =M-x org-version=), then you might want to
803 consider upgrading to a more recent version of org-mode.
805 Here are some other ideas for speeding up the agenda:
807 1. Use a one day agenda view (rather than a seven day view).
809    =(setq org-agenda-ndays 1)=
811 2. Archive inactive items to separate files.
812    
813    =C-c C-x C-s= (org-archive-subtree)
815 3. Do not include the global todo list in your agenda view.
817    (setq org-agenda-include-all-todo nil)
819 4. Make sure that your org files are byte-compiled.
821    I.e., make sure there are files ending in .elc in your org
822    installation directory.
824 ** Visual-line-mode doesn't work well with org-mode
825    :PROPERTIES:
826    :CUSTOM_ID: visual-line-mode
827    :END:
829 Visual-line-mode "soft wraps" lines so that the visual edge of the
830 buffer is considered a line break for purposes of navigation, even
831 though there is no line break in reality. 
833 In older versions of org-mode, org-beginning-of-line and
834 org-end-of-line do not work well with visual line mode. (The two
835 commands disregard soft line breaks and move to the beginning and end
836 of the hard line break.) A patch was introduces to fix this behavior
837 in July of 2009. n
839 If you are using an older version of org mode, you can:
841 1. Add a hook to turn off visual line mode.
843 2. Add the following to your =.emacs=:
845 #+begin_src emacs-lisp
847 (add-hook 'org-mode-hook
848   (lambda ()
849     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
850     (define-key org-mode-map "\C-e" 'move-end-of-line)))
852 #+end_src
853 * Faces and highlighting
854   :PROPERTIES:
855   :CUSTOM_ID: Faces
856   :END:
857 ** Org-mode has a lot of colors?  How can I change them?
858    :PROPERTIES:
859    :CUSTOM_ID: customizing-org-faces
860    :END:
862 This is a question that applies to Emacs as a whole, but it comes up
863 quite frequently on the org-mode mailing list, so it is appropriate to
864 discuss it here.
866 If you would like to change the style of a face in org-mode (or any
867 other Emacs mode), simply type =M-x customize-face [RET]= while the
868 cursor is on the color/style you are interested in modifying. You will
869 be given the opportunity to customize all the faces located at that
870 point.
872 If you would like an overview of all the faces in org-mode, you can
873 type =C-u M-x list-faces-display [RET] org= and you will be shown all
874 the faces defined by org-mode along with an illustration of their
875 current settings.
877 If you would like to customize org-faces and other aspects of
878 org-appearance, type =M-x customize-group org-font-lock [RET]=.
880 Finally, if you would like verbose information about the properties of
881 the text under the cursor, you can type =C-u C-x ==.
883 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
884 ** Why do I get a tiny font in column view when using emacs daemon?
885    :PROPERTIES:
886    :CUSTOM_ID: column-view-tiny-font
887    :END:
889 When using emacs in daemon mode (=emacs --daemon=), client frames
890 sometimes override the column view face settings, resulting in very
891 small fonts. Here is a fix:
893 #+begin_src emacs-lisp
894   (defun org-column-view-uses-fixed-width-face ()
895   ;; copy from org-faces.el
896   (when (fboundp 'set-face-attribute)
897       ;; Make sure that a fixed-width face is used when we have a column
898       ;; table.
899       (set-face-attribute 'org-column nil
900                           :height (face-attribute 'default :height)
901                           :family (face-attribute 'default :family))))
902   
903    (when (and (fboundp 'daemonp) (daemonp))
904     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
905 #+end_src
907 This fix was provided in the following mailing list post:
909 http://article.gmane.org/gmane.emacs.orgmode/27560
910 ** How can I stop the mouse cursor from highlighting lines in the agenda?
911    :PROPERTIES:
912    :CUSTOM_ID: ratpoison-for-agenda-highlighting
913    :END:
915 You can add the following to your =.emacs=:
917 #+begin_src emacs-lisp
918 (add-hook 'org-finalize-agenda-hook
919     (lambda () (remove-text-properties
920                (point-min) (point-max) '(mouse-face t))))
921 #+end_src
923 * Outline
924   :PROPERTIES:
925   :CUSTOM_ID: Outline
926   :END:
927 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
928    :PROPERTIES:
929    :CUSTOM_ID: indirect-buffers
930    :END:
932    You may use /indirect buffers/ which do exactly this.  See the
933    documentation on the command =make-indirect-buffer=.
935    Org-mode has built-in commands that allow you create an indirect
936    buffer from a subtree of an outline. To open a subtree in new
937    window, type =C-c C-x b=. Any changes you make in the new window
938    will be saved to the original file, but the visibility of both
939    buffers will remain independent of one another.
941    For multiple indirect buffers from the same file, you must use the
942    prefix =C-u= when creating the second (or third) buffer. Otherwise
943    the new indirect buffer will replace the old.
945    You can also create an independent view of an outline subtree by
946    typing =b= on an item in the agenda.
948 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
949    :PROPERTIES:
950    :CUSTOM_ID: Emacs-outlines-are-unreadable
951    :END:
953    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
954 ** C-k is killing whole subtrees!  I lost my work!
955    :PROPERTIES:
956    :CUSTOM_ID: C-k-is-killing-subtrees
957    :END:
959   =(setq org-special-ctrl-k t)= before losing your work.
961 ** Why aren't commands working on regions?
962    :PROPERTIES:
963    :CUSTOM_ID: transient-mark-mode
964    :END:
966 Some org-mode commands, such as M-right and M-left for demoting or
967 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
968 These commands, however, will only work on active regions set with
969 [[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
970 Emacs 23. To enable it in earlier versions of emacs, put the following
971 in your =.emacs= file:
973 : (transient-mark-mode 1)
975 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
976 momentary mark]] (=C-<SPC> C-<SPC>=).
978 ** Why is a blank line inserted after headlines and list items?
979    :PROPERTIES:
980    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
981    :END:
982    :PROPERTIES:
983    :CUSTOM_ID: blank-line-after-headlines-and-list-items
984    :END:
986 In org-mode, typing =M-RET= at the end of a headline will create a new
987 headline of the same level on a new line. The same is true for plain
988 lists. By default org-mode uses context to determine if a blank line
989 should be inserted after each headline or plain list item when =M-RET=
990 is pressed. For instance, if a there is a blank line before a
991 headline, then typing =M-RET= at the end of the line will insert a
992 blank line before the new headline. For instance, hitting =M-RET=
993 at the end of "Headline Two" below inserts a new headline without a
994 blank line:
996 : ** Headline One
997 : ** Headline Two
998 : **
1000 If there is a blank line between Headline One and Headline Two,
1001 however, the results will be as follows:
1003 : ** Headline One
1005 : ** Headline Two
1007 : **
1009 If you do not like the default behavior you can change it with the
1010 variable =org-blank-before-new-entry=. You can set headings and/or
1011 plain lists to auto (the default setting), t (always), or nil (never).
1013 ** How can I promote or demote multiple headlines at once?
1014    :PROPERTIES:
1015    :CUSTOM_ID: demote-multiple-headlines
1016    :END:
1018 If you have a long list of first level headlines that you'd like to
1019 demote to second level headlines, you can select the headlines as a
1020 region and then hit =M-<right>= to demote all the headlines at once.
1022 Note: =M-S-<right>= will not work on a selected region. Its use is to
1023 demote a single subtree (i.e., a headline and all sub-headlines).
1025 If M-<right> doesn't seem to work, make sure transient mark mode is
1026 enabled. See [[transient-mark-mode][this FAQ]].
1028 ** What's the deal with all the ellipses in my org outlines?
1029    :PROPERTIES:
1030    :CUSTOM_ID: org-ellipses
1031    :END:
1033 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1034 commonly, ellispes occur at the end of headings with folded content:
1036 : * Heading ...
1038 Or, for instance, they may indicate closed drawers:
1040 : :PROPERTIES: ...
1042 Sometimes, as a result of editing and cycling an outline, ellipses may
1043 appear in unexpected places. You should *never* delete these ellipses,
1044 as you may accidentally delete hidden text. Instead, you can type =C-c
1045 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1046 may type =M-x RET show-all= to reveal all text in the org file.
1048 If you would prefer a symbol or face for indicating hidden text, you
1049 can customize the variable org-ellipses.
1051 ** How do I yank a subtree so it's indented according to points' location?
1052    :PROPERTIES:
1053    :CUSTOM_ID: yank-indent-subtree
1054    :END:
1056 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1058 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1059 yanked headline's level correctly.
1061 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1063 ** Can I read org-mode outlines in vim?
1064    :PROPERTIES:
1065    :CUSTOM_ID: org-outlines-in-vim
1066    :END:
1068 Yes, there is a script that enables one to view and navigate folded
1069 outline/org files in vim (though without most of org-mode's
1070 functionality, of course).
1072   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1074 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1075 post]].
1077 * Todos and Tags
1078   :PROPERTIES:
1079   :CUSTOM_ID: Todos-and-Tags
1080   :END:
1081 ** How can I cycle through the TODO keyword of an entry?
1082    :PROPERTIES:
1083    :CUSTOM_ID: cycle-TODO-keywords
1084    :END:
1086   =C-c C-t= or =S-<left/right>= is what you need.
1088 ** How do I track state changes for tasks in Org?
1089    :PROPERTIES:
1090    :CUSTOM_ID: track-state-changes-for-tasks
1091    :END:
1093   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1094   states and logging timestamps for task state changes.
1096 ** Can I select the TODO keywords with a tag-like interface?
1097    :PROPERTIES:
1098    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1099    :END:
1101   Yes.  Use =(setq org-use-fast-todo-selection t)=
1103   If you want to set both your todos and your tags using a single
1104   interface, then check out the variable
1105   =org-fast-tag-selection-include-todo=.
1107   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1109 ** How can I quickly set the tag of an entry?
1110    :PROPERTIES:
1111    :CUSTOM_ID: quickly-set-tag-of-entry
1112    :END:
1114    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1115    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1116    keybinding for filing a note from the remember buffer.
1118    You can set tags even more quickly by setting one of the character
1119    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1121    To set tag shortcuts for all org buffers, put something like the
1122    following in your =.emacs= file (or create the same settings by
1123    typing =M-x customize-variable RET org-tag-alist=):
1125 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1127    To set tag shortcuts for a single buffer, put something like the
1128    following at the top of your org file:
1130 : #+TAGS: computer(c) office(o) home(h)
1132 ** How can I change the colors of TODO keywords?
1134 You can use the variable org-todo-keyword-faces. Here are some sample
1135 settings:
1137 #+begin_src emacs-lisp
1138 (setq org-todo-keyword-faces
1139       '(
1140         ("TODO"  . (:foreground "firebrick2" :weight bold))
1141         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1142         ("LATER"  . (:foreground "sienna" :weight bold))
1143         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1144         ("DONE"  . (:foreground "forestgreen" :weight bold))
1145         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1146         ("CANCELED"  . shadow)
1147         ))
1148 #+end_src
1150 If you want to change the color of all active todos or all inactive
1151 todos, type:
1153 : M-x customize-face RET org-todo
1154 : M-x customize-face RET org-done
1156 You can also set values for each of these in your =.emacs= file:
1158 : (set-face-foreground 'org-todo "firebrick2")
1159 : (set-face-foreground 'org-done "forestgreen")
1161 * Hyperlinks
1162   :PROPERTIES:
1163   :CUSTOM_ID: Hyperlinks
1164   :END:
1165 ** Why do I have to confirm the execution of each shell/elisp link?
1166    :PROPERTIES:
1167    :CUSTOM_ID: confirm-shell/elisp-link
1168    :END:
1170    The confirmation is there to protect you from unwantingly execute
1171    potentially dangerous commands.  For example, imagine a link
1173    : [[shell:rm -rf ~/*][Google Search]]
1175    In an Org-mode buffer, this command would look like /Google Search/,
1176    but really it would remove your home directory.  If you wish, you can
1177    make it easier to respond to the query by setting
1179    : (setq org-confirm-shell-link-function 'y-or-n-p
1180    :       org-confirm-elisp-link-function 'y-or-n-p).
1182    Then a single keypress will be enough to confirm those links.  It is
1183    also possible to turn off this check entirely, but I strongly
1184    recommend against this.  Be warned.
1186 ** Can I use RET or TAB to follow a link?
1187    :PROPERTIES:
1188    :CUSTOM_ID: RET-or-TAB-to-follow-link
1189    :END:
1191    Yes, this is how:
1193    : (setq org-return-follows-link t)
1194    : (setq org-tab-follows-link t)
1196 ** Can I keep mouse-1 clicks from following a link?
1197    :PROPERTIES:
1198    :CUSTOM_ID: mouse-1-following-link
1199    :END:
1201    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1202    link behavior similar to other applications like web browsers.  If
1203    you hold the mouse button down a bit longer, the cursor will be set
1204    without following the link.  If you cannot get used to this behavior,
1205    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1206    link activation for =mouse-1= with
1208    : (setq org-mouse-1-follows-link nil)
1210 ** How can I get completion of file names when creating a link?
1211    :PROPERTIES:
1212    :CUSTOM_ID: completion-of-file-links
1213    :END:
1215 You can use org-insert-link with a prefix argument:
1217 : C-u C-c C-l
1219 You will be greeted with prompt in the minibuffer that allows for file
1220 completion using your preferred Emacs method for finding files.
1222 * Plain Lists
1223   :PROPERTIES:
1224   :CUSTOM_ID: Plain-Lists
1225   :END:
1226 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1227    :PROPERTIES:
1228    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1229    :END:
1231 : (setq org-blank-before-new-entry
1232 :       '((heading . t) (plain-list-item . nil))
1234 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1236 ** How can I convert itemized lists to enumerated lists?
1237    :PROPERTIES:
1238    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1239    :END:
1241    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1242    bullet headlines available for lists: =-, +, *, 1., 1)=.
1244    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1246 ** How can I convert plain lists to headlines and vice versa?
1247    :PROPERTIES:
1248    :CUSTOM_ID: convert-plain-lists-to-headlines
1249    :END:
1251    To convert a plain list item or line to a headline, type =C-c *= on
1252    the headline. This will make the line a subheading of the current
1253    headline.
1255    To convert a headline to a plain list item, type =C-c -= while the
1256    cursor is on the headline.
1258    To convert a headline to an unadorned line of text, type =C-c *= on
1259    the headline.
1261    You can use query replace to accomplish the same things, as Bernt
1262    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1264 ** Is there a good way to create a description list?
1265    :PROPERTIES:
1266    :CUSTOM_ID: description-lists
1267    :END:
1269   Yes, these are now built-in:
1271 #+BEGIN_EXAMPLE
1272 - item1 :: Description of this item 1
1273 - item2 :: Description of this item 2
1274 - item1 :: Description of this item 3
1275       also in multiple lines
1276 #+END_EXAMPLE
1278 * Tables
1279   :PROPERTIES:
1280   :CUSTOM_ID: Tables
1281   :END:
1282 ** Can I plot data from a table?
1283    :PROPERTIES:
1284    :CUSTOM_ID: plotting-table-data
1285    :END:
1287    Yes, you can, using org-plot.el written by James TD Smith and now
1288    bundled with Org.  See [[http://orgmode.org/manual/Org-Plot.html#Org-Plot][the manual section about this]].
1290    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1292 ** How can I fill a table column with incremental numbers?
1293    :PROPERTIES:
1294    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1295    :END:
1297 Here is how: Use a field formula to set the first value in the column:
1299 #+begin_src org
1300 ,| N   |   |
1301 ,|-----+---|
1302 ,| :=1 |   |
1303 ,|     |   |
1304 ,|     |   |
1305 ,|     |   |
1306 ,#+TBLFM: @2$1=1
1307 #+end_src
1309 Then define a column formula in the second field:
1311 #+begin_src org
1312 ,| N        |   |
1313 ,|----------+---|
1314 ,| 1        |   |
1315 ,| =@-1 + 1 |   |
1316 ,|          |   |
1317 ,|          |   |
1318 ,#+TBLFM: @2$1=1
1319 #+end_src
1321 After recomputing the table, the column will be filled with
1322 incremental numbers:
1324 #+begin_src org
1325 ,| N |   |
1326 ,|---+---|
1327 ,| 1 |   |
1328 ,| 2 |   |
1329 ,| 3 |   |
1330 ,| 4 |   |
1331 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1332 #+end_src
1334 Note that you could use arbitrary starting values and column formulas.
1336 ** Why does my table column get filled with #ERROR?
1337    :PROPERTIES:
1338    :CUSTOM_ID: table-column-filled-with-ERROR
1339    :END:
1341    Org-mode tried to compute the column from other fields using a
1342    formula stored in the =#+TBLFM:= line just below the table, and
1343    the evaluation of the formula fails.  Fix the fields used in the
1344    formula, or fix the formula, or remove it!
1346 ** How can I stop the table editor from creating new lines?
1347    :PROPERTIES:
1348    :CUSTOM_ID: table-editor-creates-new-lines
1349    :END:
1351    When I am in the last column of a table and just above a horizontal
1352    line in the table, pressing TAB creates a new table line before the
1353    horizontal line.  To move to the line below the
1354    horizontal line instead, do this:
1356    Press =down= (to get on the separator line) and then =TAB=.
1357    Or configure the variable
1359    : (setq org-table-tab-jumps-over-hlines t)
1361 ** How can I get table fields starting with "="?
1362    :PROPERTIES:
1363    :CUSTOM_ID: table-fields-starting-with-=
1364    :END:
1366    With the setting
1368    : (setq org-table-formula-evaluate-inline nil)
1370    this will no longer happen.  You can still use formulas using the
1371    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1373 ** How can I change the indentation of an entire table without fixing every line by hand?
1374    :PROPERTIES:
1375    :CUSTOM_ID: change-indentation-entire-table
1376    :END:
1378    The indentation of a table is set by the first line.  So just fix the
1379    indentation of the first line and realign with =TAB=.
1381 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1382    :PROPERTIES:
1383    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1384    :END:
1386    Either split the table into several by inserting an empty line every
1387    100 lines or so.  Or turn off the automatic re-align with
1389    : (setq org-table-automatic-realign nil)
1391    After this the only way to realign a table is to press =C-c C-c=.  It
1392    will no longer happen automatically, removing the corresponding delays
1393    during editing.
1395 ** Recalculation of my table takes too long.  What can I do?
1396    :PROPERTIES:
1397    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1398    :END:
1400    Nothing, really.  The spreadsheet in org is mostly done to make
1401    calculations possible, not so much to make them fast.  Since Org-mode
1402    is firmly committed to the ASCII format, nothing is stopping you from
1403    editing the table by hand.  Therefore, there is no internal
1404    representation of the data.  Each time Org-mode starts a computation,
1405    it must scan the table for special lines, find the fields etc.  This
1406    is slow.  Furthermore, Calc is slow compared to hardware
1407    computations.  To make this work with normal editing, recalculation
1408    is not happening automatically, or only for the current line, so that
1409    the long wait for a full table iteration only happens when you ask
1410    for it.
1412    So for really complex tables, moving to a "real" spreadsheet may
1413    still be the best option.
1415    That said, there are some ways to optimize things in Org-mode, and I
1416    have been thinking about moving a bit further down this line.
1417    However, for my applications this has so far not been an issue at
1418    all.  If you have a good case, you could try to convince me.
1420 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1421    :PROPERTIES:
1422    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1423    :END:
1425    Well, it is /supposed/ to be a feature, to make it easy to create a
1426    column with increasing numbers.  If this gets into your way, turn it
1427    off with
1429    : (setq org-org-table-copy-increment nil)
1431 ** When I export tables to html, they don't have borders.
1432    :PROPERTIES:
1433    :CUSTOM_ID: table-borders-in-html-export
1434    :END:
1436 By default, org mode exports tables without borders.
1438 You can changed this by placing an =#+ATTR_HTML= line before the
1439 table:
1441 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1443 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1445 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1446    :PROPERTIES:
1447    :CUSTOM_ID: table-high-precision
1448    :END:
1450 - *Short answer*
1452   Avoid
1453   : | 0.16666667000000 |
1454   : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1455   and use
1456   : | 0.16666666666667 |
1457   : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1459 - *Longer answer*
1461   It is important to distinguish between the precision of
1462   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1463   2) =f14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1464   3) =%.14f=: the =printf= reformatting, limited in precision
1466   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.
1468   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1469   which are used if no format specifiers are added to a table formula.
1470   The examples below have been made with the out_of_the_box Org defaults
1471   =calc-internal-prec = 12= and =calc-float-format = 8=.
1473   Remember the formula debugger, toggled with =C-c {=,
1474   to view the processing stages like:
1475   |   | formula debugger label | processing stage           |
1476   | / | <                      | <>                         |
1477   |---+------------------------+----------------------------|
1478   |   | Result:                | output of Calc             |
1479   |   | Format:                | reformatting with =printf= |
1481   Following are some examples to demonstrate
1482   the interaction of the three precisions.
1484   - *display precision limitations for Calc formulas*
1485     - limited by Calc internal calculation precision from Org default
1486       (here =p12=)
1487       : | 0.16666666666700 |
1488       : #+TBLFM: $1 = 1 / 2 * 3;     f14
1490       : | 0.1666666666670000000 |
1491       : #+TBLFM: $1 = 1 / 2 * 3;     f19
1493     - limited by Calc float format from Org default (here =f8=)
1494       : | 0.16666667 |
1495       : #+TBLFM: $1 = 1 / 2 * 3
1497       : | 0.16666667 |
1498       : #+TBLFM: $1 = 1 / 2 * 3; p20
1500       : | 0.16666667000000 |
1501       : #+TBLFM: $1 = 1 / 2 * 3;         %.14f
1503       : | 0.16666667000000 |
1504       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.14f
1506     - limited by Calc float format specified
1507       : | 0.166667 |
1508       : #+TBLFM: $1 = 1 / 2 * 3;     f6
1510       : | 0.16666666666667 |
1511       : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1513       : | 0.1666666666666666667 |
1514       : #+TBLFM: $1 = 1 / 2 * 3; p20 f19
1516     - limited by =printf= conversion to Emacs Lisp float
1517       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1518       : #+TBLFM: $1 = 1 / 2 * 3;         %.19f
1520       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1521       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.19f
1523       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1524       : #+TBLFM: $1 = 1 / 2 * 3; p20 f20 %.19f
1526     - limited by =printf= format specified
1527       : | 0.166667 |
1528       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1530   - *display precision limitations for Emacs Lisp formulas*
1531     - limited by Emacs Lisp float
1532       : | 0.16666666666666666 |
1533       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1535       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1536       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1538     - limited by =printf= format specified
1539       : | 0.16666666666667 |
1540       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1542 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1543 and is continued in the [[#table-float-fraction][next FAQ entry]].
1545 ** Which float format shows the fraction part also when the latter is zero?
1546    :PROPERTIES:
1547    :CUSTOM_ID: table-float-fraction
1548    :END:
1550 - *Short answer*
1552   Avoid
1553   : | 1 |
1554   : #+TBLFM: $1 = 1 + 0; f3
1555   and use
1556   : | 1.000 |
1557   : #+TBLFM: $1 = 1 + 0; %.3f
1559 - *Longer answer*
1561   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]]
1562   in the section Mode Settings -> Display Modes -> Float Formats
1563   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is kept]].
1565   Remember the formula debugger, toggled with =C-c {=,
1566   to view the processing stages like:
1567   |   | formula debugger label | processing stage           |
1568   | / | <                      | <>                         |
1569   |---+------------------------+----------------------------|
1570   |   | Result:                | output of Calc             |
1571   |   | Format:                | reformatting with =printf= |
1573   Following are some examples to demonstrate different float formats.
1575   - normal precision
1576     : |----------------------+---------+-------+-------|
1577     : | number               |      f3 |   f-3 |  %.3f |
1578     : |----------------------+---------+-------+-------|
1579     : | 1 + 0                |       1 |     1 | 1.000 |
1580     : | 0 + 0                |       0 |     0 | 0.000 |
1581     : |----------------------+---------+-------+-------|
1582     : | 1 + 1 / 2 * 3 * 1000 |   1.000 | 1.000 | 1.000 |
1583     : | 0 + 1 / 2 * 3 * 1000 | 1.67e-4 | 0.000 | 0.000 |
1584     : |----------------------+---------+-------+-------|
1585     : | 1 + 1 / 2 * 3 *  100 |   1.002 | 1.002 | 1.002 |
1586     : | 0 + 1 / 2 * 3 *  100 |   0.002 | 0.002 | 0.002 |
1587     : |----------------------+---------+-------+-------|
1588     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1; %.3f
1590   - high precision
1591     : |----------------------+--------------------------+-----------------------|
1592     : | number               |                      f19 |                  f-19 |
1593     : |----------------------+--------------------------+-----------------------|
1594     : | 1 + 0                |                        1 |                     1 |
1595     : | 0 + 0                |                        0 |                     0 |
1596     : |----------------------+--------------------------+-----------------------|
1597     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1598     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1599     : |----------------------+--------------------------+-----------------------|
1600     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1601     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1602     : |----------------------+--------------------------+-----------------------|
1603     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1605     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1606     see the [[#table-high-precision][previous FAQ entry]].
1608 * Markup
1609   :PROPERTIES:
1610   :CUSTOM_ID: Footnotes
1611   :END:
1612 ** How can I get automatic renumbering of footnotes in org-mode?
1613    :PROPERTIES:
1614    :CUSTOM_ID:       footnote-auto-adjust
1615    :END:
1617 You can add the following line to your .emacs file:
1619 : (setq org-footnote-auto-adjust t)
1621 Or, if you prefer, you can turn this option on locally by placing the
1622 following line at the top of your org file:
1624 : #+STARTUP: fnadjust
1626 When auto-adjust is turned on, footnotes in the file with numerical
1627 labels will be renumbered whenever a new footnote is added. Meanwhile,
1628 all footnotes, including those with custom labels such
1629 =[fn:custom-label ]=, will be sorted in the order of their appearance
1630 in the text.
1632 This emulates the footnote behavior that many users may be familiar
1633 with from word-processing programs or from the footnote-mode included
1634 with emacs.
1636 If you do not turn on org-footnote-auto-adjust, you sort and/or
1637 renumber footnotes at any time by calling org-footnote-action with a
1638 prefix argument.
1640 ** Why isn't auto renumbering of footnotes turned on by default?
1641    :PROPERTIES:
1642    :CUSTOM_ID:       why-no-default-auto-adjust
1643    :END:
1645 Org mode has a very robust footnote mechanism allowing for a variety
1646 of types of footnotes. With some of the following footnote notations,
1647 auto-adjust may be either irrelevant or undesired:
1649  - Automatically numbered
1650  - Footnotes with custom labels
1651  - Inline footnotes
1653 In addition, org mode can be customized to place footnotes either at
1654 the end of a document or at the end of the outline heading in which
1655 they appear. Users who change this setting while editing a document
1656 may be disconcerted to find all of their footnotes rearranged
1657 automatically.
1659 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1660    :PROPERTIES:
1661    :CUSTOM_ID: auto-fill-and-unwanted-comments
1662    :END:
1664 If the following occurs:
1666 #+begin_src org
1668 #+OPTIONS: toc:nil
1669 Some entered text.
1670 # More entered tex.
1672 #+end_src
1674 Make sure that the variable comment-start is nil.
1676 ** Are there any shortcuts for entering source blocks and comment lines?
1677    :PROPERTIES:
1678    :CUSTOM_ID: shortcuts-for-entering-source-blocks
1679    :END:
1681 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
1682 and lines of code in a file. (This is especially useful when exporting
1683 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
1684 blocks of code.)
1686 #+begin_src org
1687   ,#+begin_src perl
1688   ,  print "Hello, world!\n";
1689   ,#+end_src
1690 #+end_src
1692 It can be tiresome to enter the block comment lines manually. There
1693 are several possible shortcuts you can use to enter them:
1695 1) Built-in expansion
1697    - Org mode has a "secret" method of expanding source code blocks
1698      and comment lines.
1700    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
1701      magically appear.
1703    - For a full list of expansions, type =M-x describe-variable
1704      [RET] org-structure-template-alist=.
1706 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
1708    - Add the following line to your emacs file:
1710      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
1712    - Then type =C-x r i p= to insert the source block. Please note: if
1713      you save another value to the register "p" with =C-x r s p=, it
1714      will overwrite the setting above for the current emacs session.
1716 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
1718  - Activate the abbrev minor-mode in org-mode:
1720    + M-x abbrev-mode
1722    + /Permanently/:
1724        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
1726  - In org-mode, type "sbp" (a sample abbreviation for a perl source
1727    block).
1729  - Immediately after "sbp" type =C-x a i l=.
1731  - Enter the expansion: 
1733    - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
1735    - Note: =C-q C-j= creates a new line in the minibuffer
1737  - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
1738    org-mode buffer, the src block will magically appear.
1740  - To review your list of abbrevs, type =M-x edit-abbrevs=.
1742  - If you want more complex completion (like yasnippet) you can combine
1743    abbrev mode with [[http://www.emacswiki.org/emacs/SkeletonMode][skeletons]].
1745 4) [[http://code.google.com/p/yasnippet/][Yasnippet]]
1747  - Several org-mode users install yasnippet for convenient, complex
1748    expansion.
1750  - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
1751    yasnippet.
1753 * Remember
1754   :PROPERTIES:
1755   :CUSTOM_ID: Remember
1756   :END:
1757 ** Can I use the remember buffer to clock a customer phone call?
1758    :PROPERTIES:
1759    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
1760    :END:
1762   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
1763   and check out (in the same thread) what Nick Docos had to fix to
1764   make Bernt's set-up work for him.
1765 ** Can I automatically start the clock when opening a remember template?
1766    :PROPERTIES:
1767    :CUSTOM_ID: start-clock-when-opening-remember-template
1768    :END:
1770    Yes, this is possible.  Use the following code and make sure that
1771    after executing it, `my-start-clock-if-needed' is in
1772    `remember-mode-hook' /after/ `org-remember-apply-template'.
1774    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
1775    : (defun my-start-clock-if-needed ()
1776    :   (save-excursion
1777    :     (goto-char (point-min))
1778    :     (when (re-search-forward " *CLOCK-IN *" nil t)
1779    :       (replace-match "")
1780    :       (org-clock-in))))
1782    Then, when a template contains the key string CLOCK-IN, the clock
1783    will be started.  Starting with Org-mode version 5.20, the clock will
1784    automatically be stopped when storing the remember buffer.
1786 * Searches
1787   :PROPERTIES:
1788   :CUSTOM_ID: Searches
1789   :END:
1790 ** Isearch does not find string hidden in links.  What can I do?
1791    :PROPERTIES:
1792    :CUSTOM_ID: isearch-in-links
1793    :END:
1795   M-x =visible-mode= will display the full link, making them searchable.
1797 ** How can I reduce the amount of context shown in sparse trees?
1798    :PROPERTIES:
1799    :CUSTOM_ID: context-in-sparse-trees
1800    :END:
1802    Take a look at the following variables:
1804    - =org-show-hierarchy-above=
1805    - =org-show-following-headline=
1806    - =org-show-siblings=
1807    - =org-show-entry-blow=
1809    which give command-dependent control over how much context is shown
1810    by a particular operation.
1812 ** How can I combine the results of two calls to =org-occur=?
1813    :PROPERTIES:
1814    :CUSTOM_ID: two-calls-to-org-occur
1815    :END:
1817    You can construct a regular expression that matches all targets you
1818    want.  Alternatively, use a =C-u= prefix with the second and any
1819    further calls to =org-occur= to keep the current visibility and
1820    highlighting in addition to the new ones.
1822 * Agenda
1823   :PROPERTIES:
1824   :CUSTOM_ID: Agenda
1825   :END:
1826 ** How can I change the advanced warning time for deadlines?
1827 ##<<warning-period-for-deadlines>>
1829 Deadline warnings appear in the daily agenda view a specified number
1830 of days before the deadline is due. The default setting is 14 days.
1831 You can change this with the variable =org-deadline-warning-days=.
1832 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
1834 For instance,
1836 : (setq org-deadline-warning-days 30)
1838 would cause warnings for each deadline to appear 30 days in advance.
1840 Naturally, you might not want warnings for all of your deadlines to
1841 appear so far in advance. Thus, you can change the lead time for
1842 individual items as follows:
1844 : * TODO Get a gift for the party
1845 :   DEADLINE: <2009-01-16 Fri -2d>
1847 The "-2d" above changes the lead time for this deadline warning to two
1848 days in advance. You can also use "w" for weeks and "m" for months.
1849 ** How can I postpone a task until a certain date?
1850    :PROPERTIES:
1851    :CUSTOM_ID: deferring-tasks
1852    :END:
1854 The easiest way to postpone a task is to schedule it in the future.
1855 For instance, typing =C-c C-s +2w= on a headline will push a task two
1856 weeks into the future, so that it won't show up on the daily agenda
1857 until two weeks from now.
1859 If you'd like to prevent the task from showing up on your global todo
1860 list, you have a couple of options.
1862 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
1863    This will exclude any scheduled items from your global list of
1864    active todos (=C-c a t=). (The variable
1865    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
1866    deadline items from your todo list).
1867 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
1868    item will still appear on your agenda two weeks from today, but it
1869    won't show up on your todo lists.
1870 ** Can I send myself an email containing tasks or other agenda info?
1871    :PROPERTIES:
1872    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
1873    :END:
1875    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
1877 ** How can I limit the agenda view to my "work" tasks?
1878    :PROPERTIES:
1879    :CUSTOM_ID: limit-agenda-with-tag-filtering
1880    :END:
1882    It is often convenient to group org files into separate categories,
1883    such as "home" and "work" (or "personal" and "professional"). One
1884    of the main reasons for such classification is to create agenda
1885    views that are limited by type of work or area of responsibility.
1886    For instance, while at work, one may want to see only professional
1887    tasks; while away from work, one may want to see only personal
1888    tasks.
1890    One way to categorize files and tasks is to use a "#+FILETAGS"
1891    declaration at the top of each file, such as:
1893    : #+FILETAGS: work
1895    As long as org-use-tag-inheritance is turned on, the filetags will
1896    be inherited by all tasks in the file. A file can have multiple
1897    filetags. And, of course, tags can be added to individual headings.
1899    Tasks can be quickly filtered by tag from within the agenda by
1900    typing "/" and the name of the tag. The full key sequence to filter
1901    for work items in an agenda view would be:
1903    : C-c a a / work [or a tag shortcut]
1905 ** How can I limit the agenda view to a particular category?
1906    :PROPERTIES:
1907    :CUSTOM_ID: limit-agenda-with-category-match
1908    :END:
1910    Another way to filter agenda views by type of work is to use a
1911    "#+CATEGORY" declaration at the top of each file, such as:
1913    : #+CATEGORY: work
1915    Categories can also be added to individual headings within a file:
1917    : * Big project
1918    :   :PROPERTIES:
1919    :   :CATEGORY: work
1920    :   :END:
1922    All todos belonging to the category "work" can be found a with a
1923    simple tags-todo search:
1925    : C-c a M
1927    At the prompt, type:
1929    : CATEGORY="work"
1931    The same results can be achieved with custom agenda commands, such as:
1933 #+BEGIN_SRC emacs-lisp
1934 (setq org-agenda-custom-commands
1935       '(("h" tags-todo "CATEGORY=\"home\"")
1936         ("w" tags-todo "CATEGORY=\"work\"")
1937         ;; other custom agenda commands here
1938         ))
1939 #+END_SRC
1941 ** How can include all org files in a directory in my agenda?
1942    :PROPERTIES:
1943    :CUSTOM_ID: set-agenda-files-using-wildcards
1944    :END:
1946 You can simply include the directory (as one of the items) in the
1947 value of the variable org-agenda-files:
1949 : (setq org-agenda-files '("/my/special/path/org/"))
1951 There is another way of accomplishing the same end:
1953 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
1955 ** Why aren't items disappearing from my agenda once they are marked done?
1956    :PROPERTIES:
1957    :CUSTOM_ID: removing-done-items-from-agenda
1958    :END:
1960 If items remain on your daily/weekly agenda after they are marked
1961 done, check the configuration of the following variables:
1963 : org-agenda-skip-scheduled-if-done
1964 : org-agenda-skip-deadline-if-done
1965 : org-agenda-skip-timestamp-if-done
1967 For instance, type:
1969 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
1971 If this variable is turned off (=nil=), then scheduled items will
1972 remain on the agenda even after they are marked done.
1974 If the variable is turned on (=t=), then scheduled items will
1975 disappear from the agenda after they are marked done.
1977 If these settings seem not to behave the way you expect, then make
1978 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
1979 difference between SCHEDULED, DEADLINE, and timestamps]].
1981 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
1982    :PROPERTIES:
1983    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
1984    :END:
1986 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
1987    the day they are scheduled and on every day thereafter until they
1988    are done. Schedule a task if you want to be reminded to do
1989    something beginning on a certain day and until it is done.
1991 : ** TODO Scheduled item
1992 :    SCHEDULED: <2009-03-01 Sun>
1994 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
1995    agenda in advance of the when they are due and remain on your
1996    agenda until they are done. Add a DEADLINE to an item if you want
1997    to make sure to complete it by a certain date. (The variable
1998    org-deadline-warning-days determines how far in advance items with
1999    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2000    information.)
2002 : ** TODO Item with a deadline
2003 :    DEADLINE: <2009-01-20 Tue>
2005 3. An active timestamp (set with =C-c .=) will appear on your agenda
2006    only on the day it is scheduled. Use a timestamp for appointments
2007    or any reminders you want to show up only on a particular day.
2009 : ** TODO Item with an active timestamp
2010 : <2009-04-18 Sat>
2012 Note: items with inactive timestamps (set with C-c ! and marked by
2013 square brackets) will not show up in the agenda at all.
2015 ** Can I add files recursively to my list of agenda files?
2016    :PROPERTIES:
2017    :CUSTOM_ID: set-agenda-files-recursively
2018    :END:
2020 Yes, you can use the library "find-lisp."
2022 : (load-library "find-lisp")
2023 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2025 This will add all files ending in =org= in the directory "~/org"
2026 and all of its subdirectories to your list of agenda files.
2028 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2030 ** Why does an item appearing at the wrong time of day in my agenda?
2031    :PROPERTIES:
2032    :CUSTOM_ID: agenda-wrong-time-of-day
2033    :END:
2035 When preparing the agenda view, org-mode scans each relevant headline
2036 for a time designation. This approach is very nice for adding
2037 free-form timestamps to an item for scheduling. Thus, either of the
2038 following work would work to schedule an item at 10:00am:
2040 #+begin_src org
2041 ,** 10:00am Get dried ice at the magic store
2042 ,   SCHEDULED: <2009-05-27 Wed>
2043 #+end_src
2045 #+begin_src org
2046 ,** Get dried ice at the magic store
2047 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2048 #+end_src
2050 To enable this flexibility, org-mode scans the entire headline for
2051 time of day notation. A potential problem can arise if you use
2052 inactive timestamps in the headline to note when an item was created.
2053 For example,
2055 #+begin_src org
2056 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2057 ,   SCHEDULED: <2009-05-27 Wed>
2058 #+end_src
2060 Org mode would interpret the time in the inactive timestamp as a
2061 time-of-day indicator and the entry would appear in your agenda at
2062 12:58.
2064 If you would like to turn off the time-of-day search, you can
2065 configure the variable =org-agenda-search-headline-for-time= (requires
2066 org-mode >= 6.24).
2068 ** How can I change the visibility of an item from the agenda?
2069    :PROPERTIES:
2070    :CUSTOM_ID: cycling-visibility-from-agenda
2071    :END:
2073 You can add a keybinding as follows:
2075 #+begin_src emacs-lisp
2076 (add-hook 'org-agenda-mode-hook
2077    (lambda ()
2078      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2079 #+end_src
2081 Then, as you press SPACE on an item on the agenda, it will cycle the
2082 visibility of its original location.
2084 * Appointments/Diary
2085   :PROPERTIES:
2086   :CUSTOM_ID: Appointments/Diary
2087   :END:
2088 ** Is it possible to include entries from org-mode files into my emacs diary?
2089    :PROPERTIES:
2090    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2091    :END:
2093    Since the org-mode agenda is much more powerful and can contain the
2094    diary, you should think twice before deciding to do this.  If you
2095    insist, however, integrating Org-mode information into the diary is
2096    possible.  You need to turn on /fancy diary display/ by setting in
2097    .emacs:
2099    : (add-hook 'diary-display-hook 'diary-fancy-display)
2101    Then include the following line into your ~/diary file, in
2102    order to get the entries from all files listed in the variable
2103    =org-agenda-files=
2105    : &%%(org-diary)
2107    You may also select specific files with
2109    : &%%(org-diary) ~/path/to/some/org-file.org
2110    : &%%(org-diary) ~/path/to/another/org-file.org
2112    If you now launch the calendar and press @<tt>d@</tt> to display a
2113    diary, the headlines of entries containing a timestamp, date range,
2114    schedule, or deadline referring to the selected date will be listed.
2115    Just like Org-mode's agenda view, the diary for /today/ contains
2116    additional entries for overdue deadlines and scheduled items.  See
2117    also the documentation of the =org-diary= function.  Under XEmacs, it
2118    is not possible to jump back from the diary to the org, this works
2119    only in the agenda buffer.
2120 ** I want to add my Org scheduled/deadlined entries in my diary!
2121    :PROPERTIES:
2122    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2123    :END:
2125   Put this in your ~/.diary:
2127   : &%%(org-diary :scheduled :timestamp :deadline)
2129 ** How can I set up automatic reminders based on Org information?
2130    :PROPERTIES:
2131    :CUSTOM_ID: automatic-reminders
2132    :END:
2134   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2135 ** How can I make =appt= notice my Org appointments?
2136    :PROPERTIES:
2137    :CUSTOM_ID: appt-notice-my-Org-appointments
2138    :END:
2140   : M-x org-agenda-to-appt RET
2142 ** How can I create more complex appointments in my org-files?
2143    :PROPERTIES:
2144    :CUSTOM_ID: diary-sexp-in-org-files
2145    :END:
2147 Org-mode's active timestamps work very well for scheduling individual
2148 or recurring appointments, such as:
2150 #+begin_src org
2151   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2152 #+end_src
2155 #+begin_src org
2156   ,* Vacation
2157   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2158 #+end_src
2162 #+begin_src org
2163   ,* Weekly meeting with boss
2164   ,  <2009-01-20 Tue 14:00 +1w>
2165 #+end_src
2167 Sometimes, however, you need to set up more complicated recurring
2168 appointments. Org-mode has built-in support for many of
2169 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2170 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
2171 instance, that you teach a class that meets every Monday evening
2172 between February 16 and April 20, 2009. The way to enter this an
2173 org-mode file is:
2175 #+begin_src org
2176   ,** Class 7:00pm-9:00pm
2177   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2178 #+end_src
2180 The expression above designates all Mondays that fall between February
2181 16 and April 20. How exactly does it work?
2183  - (and... :: Indicates that *both* of the conditions that follow have
2184           to be true.
2186    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2187         Monday?
2189        - Note: the function calendar-day-of-week converts the date to the day of week
2190          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2192    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2193         these two dates?
2195 You can make a sexp as complex as you like. If you wanted to omit a
2196 week because of holidays, for instance, you could add another
2197 condition to the sexp:
2199 #+begin_src org
2200   ,** Class 7:00pm-9:00pm
2201   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2202 #+end_src
2204 The sexp above would omit Monday during the week of March 9, 2009. For
2205 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2207 Another diary function commonly used for more complex scheduling is
2208 diary-float. For instance,
2210 #+begin_src org
2211   ,* Monthly meeting
2212   ,  <%%(diary-float t 3 3)>
2213 #+end_src
2215 ...would appear on the third Wednesday of every month.
2217 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2218 page on the Emacs wiki]].
2220 ** How can I schedule a weekly class that lasts for a limited period of time?
2221    :PROPERTIES:
2222    :CUSTOM_ID: org-diary-class
2223    :END:
2225 Org-mode offers a convenient diary sexp function for setting up a
2226 recurring appointment that lasts for a certain period of time, such as
2227 a class. It is called org-diary-class and it can be entered as
2228 follows:
2230 #+begin_src org
2231   ,** Class 7:00pm-9:00pm
2232   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2233 #+end_src
2235 The function above schedules an appointment for every Monday (1)
2236 between February 16 and April 20, 2009, except for ISO week 10 (March
2237 1 to March 7).
2239 The function org-diary-class has the following format:
2241 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2243 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2244 takes the form of a number indicating the day of the week (0 = Sunday,
2245 1 = Monday, and so on...). In addition, one can add an optional
2246 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2247 skipped. This argument should be expressed as an ISO week number. You
2248 can find the number by invoking emacs' built-in calendar (=M-x
2249 calendar=), navigating to the appropriate week, and typing =p c=
2250 (calendar-iso-print-date).
2252 ** How can I set an event to occur every day except Saturday and Sunday?
2254    #+begin_example
2255    ** Daily meeting
2256       <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2257    #+end_example
2259 * Export
2260   :PROPERTIES:
2261   :CUSTOM_ID: Export
2262   :END:
2263 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2264    :PROPERTIES:
2265    :CUSTOM_ID: export-TODO-items-as-lists
2266    :END:
2268    If you plan to use ASCII or HTML export, make sure things you want to
2269    be exported as item lists are level 4 at least, even if that does
2270    mean there is a level jump.  For example:
2272    : * Todays top priorities
2273    : **** TODO write a letter to xyz
2274    : **** TODO Finish the paper
2275    : **** Pick up kids at the school
2277    Alternatively, if you need a specific value for the heading/item
2278    transition in a particular file, use the =#+OPTIONS= line to
2279    configure the H switch.
2281    : #+OPTIONS:   H:2; ...
2283 ** Can I export only a single subtree?
2284    :PROPERTIES:
2285    :CUSTOM_ID: export-single-subtree
2286    :END:
2288    If you want to export a subtree, mark the subtree as region and then
2289    export.  Marking can be done with =C-c @ C-x C-x=, for example.
2291 ** How can I tell my calendar web application about appointments in my agenda files?
2293 Here is what you need to do:
2295 1. a script that calls Emacs in batch mode and produce a .ics file
2296 2. a script that uploads this .ics file somewhere on the web
2297 3. tell your webapp to fetch this .ics file on the web
2299 Here is the script I use for the first step:
2301 #+begin_src shell-script-mode
2302 #!/bin/bash
2304 /usr/local/bin/emacs --batch --eval \
2305 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2306         (load-file \"~/elisp/config/org-batch-config.el\") \
2307         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2308         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2309     -f org-export-icalendar-combine-agenda-files
2310 #+end_src
2312 Depending on your configuration, you might change the load sequence.
2314 Here is the script I use for the second step:
2316 #+begin_src shell-script-mode
2317 #!/bin/bash
2318 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2319 #+end_src
2321 Note: if you want to cron this rsync script, you will need to let
2322 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2323 starter.
2325 Now you can cron the two scripts above and your webapp will always be
2326 up to date with your Org agendas.
2328 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2330 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2331    :PROPERTIES:
2332    :CUSTOM_ID: iCal-import-ics-files-old
2333    :END:
2335    When using iCal under Apple MacOS X Tiger, you can create a new
2336    calendar /OrgMode/ (the default name for the calendar created by =C-c
2337    C-e c=, see the variables =org-icalendar-combined-name= and
2338    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2339    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2340    You may even use AppleScript to make iCal re-read the calendar files
2341    each time a new version of /OrgMode.ics/ is produced.  Here is the
2342    setup needed for this:
2344    : (setq org-combined-agenda-icalendar-file
2345    :     "~/Library/Calendars/OrgMode.ics")
2346    : (add-hook 'org-after-save-iCalendar-file-hook
2347    :  (lambda ()
2348    :   (shell-command
2349    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2351 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2352    :PROPERTIES:
2353    :CUSTOM_ID: iCal-import-ics-files-new
2354    :END:
2356    For Mac OS X 10.4, you need to write the ics file to
2357    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2358    =http: //localhost/orgmode.ics=
2360 ** How can I remove timestamps and todo keywords from my exported file?
2361    :PROPERTIES:
2362    :CUSTOM_ID: export-options-remove-timestamps
2363    :END:
2365 You can place an options line at the top of your org file:
2367 : #+OPTIONS: <:nil todo:nil
2369 There is a whole host of export options you can set with an in-buffer
2370 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2371 full list.
2373 ** How can I preserve faces when I export an agenda from the command line?
2374    :PROPERTIES:
2375    :CUSTOM_ID: preserving-faces-during-batch-export
2376    :END:
2378 Normally, when you export an org file or an agenda view from within
2379 emacs, htmlize will convert your face definitions to direct color css
2380 styles inlined into each =<span>= object, resulting in an HTML output
2381 that preserves the general look of your Org buffers and agenda views.
2383 Let's say you generate an export from the command line, such as the
2384 following:
2386 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2390 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2392 In such an instance, the exported HTML will contain only very basic
2393 color styles. The reason is that when Emacs is run in batch mode, it
2394 does not have a display and therefore only rudimentary face
2395 definitions.  If you'd like to use more complex styles, you'll have to
2396 make sure that the export process only assigns classes instead of
2397 direct color values.  This can be done by binding the variable
2398 =org-export-htmlize-output-style= to =css= for the duration of the
2399 export, for example with
2401 : emacs -batch -l ~/.emacs
2402 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
2403 :            (org-batch-agenda "e"))'
2405 Then you can use a style file to make these classes look any way you
2406 like.  To generate face definitions for a CSS file based on any faces
2407 you are currently using in Emacs, you can use the following command:
2409 : M-x org-export-htmlize-generate-css RET
2411 This will generate a =<style>...</style>= section, the content of
2412 which you can add to your style file.
2414 ** How can I avoid dark color background when exporting agenda to ps format?
2415    :PROPERTIES:
2416    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2417    :END:
2419 Add this to your .emacs and evaluate it.
2421 #+BEGIN_SRC emacs-lisp
2422   (setq org-agenda-exporter-settings
2423         '((ps-print-color-p 'black-white)))
2424 #+END_SRC
2426 ** How can I get colored source code when exporting to LaTeX?
2427    :PROPERTIES:
2428    :CUSTOM_ID: fontified_source_code_w_latex
2429    :END:
2431 As of Sun Aug 9 2009 the "current" version of Org-mode (see
2432 [[keeping-current-with-Org-mode-development]]) supports exporting source
2433 code to LaTeX using the listings package.
2435 To turn on listing export add the following to your Org-mode
2436 customization.
2437 #+begin_src emacs-lisp
2438   ;; requite org-latex so that the following variables are defined
2439   (require 'org-latex)
2440   
2441   ;; tell org to use listings
2442   (setq org-export-latex-listings t)
2443   
2444   ;; you must include the listings package
2445   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
2446   
2447   ;; if you want colored source code then you need to include the color package
2448   (add-to-list 'org-export-latex-packages-alist '("" "color"))
2449 #+end_src
2451 The listings package will now be used to fontify source code in your
2452 LaTeX documents.  By default listings will not color any of your
2453 source code.  If you would like to set colors for keywords and
2454 comments in your latex documents you can do so using LaTeX directives
2455 like the following.
2456 #+begin_src latex
2457   \lstset{keywordstyle=\color{blue},
2458     commentstyle=\color{red},
2459     stringstyle=\color{green}
2460   }
2461 #+end_src
2463 of if you want to get even fancier with your colors you can try
2464 something like the following
2465 #+begin_src latex
2466 \definecolor{keywords}{RGB}{255,0,90}
2467 \definecolor{comments}{RGB}{60,179,113}
2468 \definecolor{fore}{RGB}{249,242,215}
2469 \definecolor{back}{RGB}{51,51,51}
2470 \lstset{
2471   basicstyle=\color{fore},
2472   keywordstyle=\color{keywords},  
2473   commentstyle=\color{comments},
2474   backgroundcolor=\color{back}
2476 #+end_src
2478 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
2480 ** How can I export to Latex Beamer
2481    :PROPERTIES:
2482    :CUSTOM_ID: beamer
2483    :END:
2484 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
2485 The following can be used to export Org-mode documents to LaTeX
2486 beamer.
2488 Add the following to your Emacs initialization file.
2489 #+begin_src emacs-lisp
2490   (unless (boundp 'org-export-latex-classes)
2491     (setq org-export-latex-classes nil))
2492   (add-to-list 'org-export-latex-classes
2493                '("beamer"
2494                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
2495                  ("\\section{%s}" . "\\section*{%s}")
2496                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
2497                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
2498 #+end_src
2500 Then by placing
2501 : #+LaTeX_CLASS: beamer
2502 in the header of your Org-mode document it will automatically export
2503 to the Beamer document class on LaTeX export.  With the above
2504 configuration top-level headers will be mapped to sections in the
2505 Beamer document, second-level headers will be mapped to frames, and
2506 lower level headlines will be mapped to itemize objects.
2508 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
2509 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
2510 Thomas Dye]].
2512 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
2514 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
2515 aids in creation of bibliographies, cross-references, indexes, and
2516 glossaries.  RefTeX understands the structure of multi-file LaTeX
2517 documents and is able to collect from them information about the
2518 location(s) of external data stores used in creation of the final
2519 document.  RefTeX was written by Carsten Dominik and is currently
2520 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
2522 *** Using RefTeX In Org-mode Files for LaTeX Export
2523 In Org-mode files for LaTeX export, the trick is to find a way to tell
2524 RefTeX the locations of external data stores.  One way is to set the
2525 variable, =reftex-default-bibliography=.  Add lines like these to
2526 .emacs:
2528 #+begin_src emacs-lisp 
2529   (setq reftex-default-bibliography
2530         (quote
2531          ("default.bib" "other-default.bib")))       
2532 #+end_src
2534 In practice, this is a limited solution and the
2535 typical user will want to pass this information on a per-file basis.
2536 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
2537 Braindump]].  
2539 The first solution, proposed by Mario, enables the RefTeX citation
2540 function in Org-mode.  Add these lines to .emacs:
2542 #+begin_src emacs-lisp
2543   (defun org-mode-reftex-setup ()
2544     (load-library "reftex")
2545     (and (buffer-file-name)
2546          (file-exists-p (buffer-file-name))
2547          (reftex-parse-all))
2548     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
2549   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
2550 #+end_src
2552 Then add the following lines anywhere in the Org-mode file (Org-mode
2553 will recognize them as LaTeX commands):
2555 #+begin_src org
2556 \bibliographystyle{plain}
2557 \bibliography{BIB-NAME}
2558 #+end_src
2560 With this setup, =C-c )= will invoke =reftex-citation= which will
2561 insert a reference in the usual way:
2563 #+begin_src org
2564   ,* test reftex
2565   
2566   ,This is a citation \cite{tierney90}.
2567   
2568   ,\bibliographystyle{plain}
2569   ,\bibliography{tsd}
2570 #+end_src
2572 This Org-mode file will export the following LaTeX output:
2574 #+begin_src latex :exports code
2575   % Created 2010-03-22 Mon 14:34
2576   \documentclass[11pt,letter]{article}
2577   \usepackage[utf8]{inputenc}
2578   \usepackage[T1]{fontenc}
2579   \usepackage{hyperref}
2580   
2581   \title{test.org}
2582   \author{Tom Dye}
2583   \date{2010-03-22 Mon}
2584   
2585   \begin{document}
2586   
2587   \maketitle
2588   
2589   \setcounter{tocdepth}{3}
2590   \tableofcontents
2591   \vspace*{1cm}
2592   
2593   \section{test reftex}
2594   \label{sec-1}
2595   
2596   
2597   This is a citation \cite{tierney90}.
2598   
2599   \bibliographystyle{plain}
2600   \bibliography{tsd}
2601   
2602   \end{document}
2603 #+end_src
2606 A second solution, to activate the RefTeX minor mode on a per-file
2607 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
2608 Add the following lines to .emacs:
2610 #+begin_src emacs-lisp
2611   (add-hook ‘org-mode-hook
2612              (lambda ()
2613                (if (member “WRITE” org-todo-keywords-1)
2614                    (org-mode-article-modes))))
2615 #+end_src
2617 where =org-mode-article-modes= is defined as follows:
2619 #+begin_src emacs-lisp
2620   (defun org-mode-article-modes ()
2621     (reftex-mode t)
2622     (bib-cite-minor-mode t)
2623     (and (buffer-file-name)
2624          (file-exists-p (buffer-file-name))
2625          (reftex-parse-all)))
2626 #+end_src
2628 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
2629 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
2630 like this:
2632 #+begin_src org
2633   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
2634 #+end_src
2636 With this setup, you insert a citation with =M-x reftex-citation RET=.
2638 *** Using RefTeX in Org-babel LaTeX Code Blocks
2640 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
2641 information in other Org-babel LaTeX code blocks.  If you use an Emacs
2642 starter kit where configuration information is held in Org-mode files,
2643 then the second solution is preferable because you won't be asked for
2644 a master file when Emacs is started.  For this reason, the second
2645 solution is modified for use with Org-babel latex code blocks.  No
2646 key-binding is needed here because Org-babel code blocks are edited
2647 within the usual AucTeX environment.
2649 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]])
2650 #+begin_src emacs-lisp
2651   (defun org-mode-article-modes ()
2652     (reftex-mode t)
2653     (and (buffer-file-name)
2654          (file-exists-p (buffer-file-name))
2655          (reftex-parse-all)))
2656   
2657   (add-hook 'org-mode-hook
2658             (lambda ()
2659               (if (member "REFTEX" org-todo-keywords-1)
2660                   (org-mode-article-modes))))
2661 #+end_src
2663 Then add a line like the following line to the top of your org-mode file:
2665 #+begin_src org
2666   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
2667 #+end_src
2669 When you open an org-mode file with a line like this, RefTeX will
2670 prompt for the master .tex file, which will be parsed in the usual
2671 way.  This means that the .tex file should already exist, perhaps by
2672 tangling the LaTeX preamble and postamble, before
2673 =org-mode-article-modes= is activated for the Org-mode file.
2675 * MobileOrg
2677 ** Which versions of MobileOrg do exist
2678    :PROPERTIES:
2679    :CUSTOM_ID: mobileorg_versions
2680    :END:
2682 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
2683   Richard Moreland.  Check out
2684   [[http://mobileorg.ncogni.to/][Richard's page]]
2685 - Matt Jones is developing a feature-equivalent application for
2686   Android, see
2687   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
2689 ** What can I do if I don't want to use Dropbox.com
2690    :PROPERTIES:
2691    :CUSTOM_ID: mobileorg_webdav
2692    :END:
2694 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
2695 you can get a free account there.  If for some reason you cannot or do
2696 not want to use this path, you can use any webdav server.  On this
2697 webdav server you need to create a dedicated directory for the
2698 communication between Emacs and MobileOrg.  If you can mount that
2699 directory locally so that Emacs can directly write to it, just point
2700 to that directory using the variable =org-mobile-directory=.  Using
2701 the /tramp/ method, =org-mobile-directory= may point to a remote
2702 directory accessible through, for example, /ssh/ and /scp/:
2704 #+begin_src emacs-lisp
2705 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
2706 #+end_src
2708 If Emacs cannot access the WebDAV directory directly using a /tramp/
2709 method, you can use a local directory for staging.  Other means must
2710 then be used to keep this directory in sync with the WebDAV directory.
2711 In the following example, files are staged in =~/stage/=, and Org-mode
2712 hooks take care of moving files to and from the WebDAV directory using
2713 /scp/.
2715 #+begin_src emacs-lisp
2716 (setq org-mobile-directory "~/stage/")
2717 (add-hook 'org-mobile-post-push-hook
2718   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
2719 (add-hook 'org-mobile-pre-pull-hook
2720   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
2721 (add-hook 'org-mobile-post-pull-hook
2722   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
2723 #+end_src
2725 * COMMENT HTML style specifications
2727 #+begin_src emacs-lisp
2728   (defun org-faq-make-target ()
2729     "Make hard target for current headline."
2730     (interactive)
2731     (if (not (org-on-heading-p))
2732         (error "Not on a headline"))
2733     (let ((h (org-trim (org-get-heading 'no-tags))))
2734       (if (string-match "[ \t]*\\?\\'" h)
2735           (setq h (replace-match "" t t h)))
2736       (while (string-match "[ \t]+" h)
2737         (setq h (replace-match "-" t t h)))
2738       (org-entry-put nil "CUSTOM_ID" h)))
2739 #+end_src