2 #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t
3 #+EMAIL: carsten.dominik@gmail.com
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
11 <a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
14 [[file:index.org][{Back to Worg's index}]]
21 Welcome to the Org-mode FAQ.
23 You can navigate the FAQ by clicking on any of the topics in the Table
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
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
40 :CUSTOM_ID: What-is-org-mode
42 ** Can I implement a GTD workflow with Org-mode?
44 :CUSTOM_ID: GTD-workflow-with-Org-mode
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?
51 :CUSTOM_ID: Org-and-TaskPaper
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?
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
81 - It will take forever to learn everything there is to know about a
84 - A unicorn is a fabulous creature. Org-mode wants to be a fabulous
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
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.
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.
126 ** Why hasn't my email to the mailing list shown up yet?
128 :CUSTOM_ID: ml-post-delay
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?
138 :CUSTOM_ID: ml-subscription-and-gmane
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"
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.
155 :CUSTOM_ID: Keeping-current
157 ** How do I keep current with Org mode development?
159 :CUSTOM_ID: keeping-current-with-Org-mode-development
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
204 : $ git pull && make clean && make && make doc && make install
206 6. You should restart org mode to have the changes take effect (if
207 you are not rebooting Emacs.) Also since the intention is to
208 "keep up" with Org mode, you should visit updated sections of
209 documentation for latest updates (use =git log=.)
211 7. As you use your repository over time it will accumulate loose objects.
212 You can reduce the total size of your git repository with
216 which will consolidate loose git objects into pack files. This
217 reduces the size of the repository and speeds up data access to
220 ** How can I keep local changes and still track Org mode development?
222 :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
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
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
235 : $ git commit -m 'My local Makefile configurations'
236 : # Update git to a newer version
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
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=
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
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:
275 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
276 make it work well on our system.
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
289 - Make our custom changes
291 Edit the makefile so it looks like this:
301 - Create a commit with our custom changes
303 : $ git commit -m 'My local Makefile configurations'
305 - Later we do a =git pull= but that fails with conflicts.
308 : remote: Counting objects: 5, done.
310 : Patch failed at 0001.
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
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
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"
352 : $ git rebase --abort
355 ** How can I use a stable release version instead of the bleeding edge master?
357 :CUSTOM_ID: using-stable-releases-only
360 The master branch of the git repository always contains the bleeding
361 edge development code. This is important for Org's fast development,
362 because code on master gets checked out by many people daily and we
363 quickly receive bug reports if something is wrong. On rare occasions,
364 this code may not function perfectly for a limited time while we are
365 trying to fix things.
367 Not everyone like to use this bleeding-edge code and face the danger
368 to hit a surprising bug.
370 Therefore, from time to time, we make a release. This typically
371 happens when the maintainers feel that
373 1. they have reached a good point in the development
374 2. the code has a feature set that should stay and be supported in the
377 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
378 Org, and they are also the code that gets merged into the Emacs
379 distribution. If you want to work only with stable releases, you can
380 still use the git repository to do so.
382 *** Run a specific stable release
384 In the repository, do
389 To see which release tags are available. Let's say you decide to use
392 : $ git checkout release_7.01f
394 This set the working tree of the repository to the state of Org at the
395 moment of release 7.01f. You can then run Org from the repository be
396 sure to use the stable release while development continues on the
399 Later, when we release 7.02, you can switch to that using
401 : $ git fetch --tags # to get all the new stuff
403 : $ git checkout release_7.02
405 *** Always run the most recent stable release
407 Alternatively, if you just want to always run whatever the latest
408 stable release is, you can do
410 : $ git checkout -b stable origin/maint
412 and then regularly update this branch by doing
416 ** How can I install an up-to-date version of org-mode without "make" tools?
418 :CUSTOM_ID: installing-org-without-make-tools
421 If you are using org-mode on a computer that lacks developer tools for
422 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
423 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
425 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
426 you can install a recent version of org-mode without using the
427 customary =make clean && make && make install=.
429 The result of that discussion is the file/function found in
430 [[http://orgmode.org/worg/org-hacks.php#compiling-org-without-make]].
432 ** How do I download fresh .zip and .tar.gz archives of Org?
434 You can download [[http://orgmode.org][org-latest.zip]] or [[http://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] -- these
435 archives are udpated every day at midnight.
441 ** How can I quickly browse all Org options?
443 =M-x org-customize RET=
445 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
448 ** Can I use the editing features of org-mode in other modes?
450 :CUSTOM_ID: use-editing-features-in-other-modes
453 Not really---but there are a few editing features you can use in
456 - For tables there is =orgtbl-mode= which implements the table
457 editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
458 - For ordered lists there is =orgstuct-mode= which allows for easy
459 list editing as a minor mode. (To enable, type =M-x
462 You can activate these modes automatically by using hooks:
464 : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
465 : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
467 For footnotes, there is the function =org-footnote-action=, which
468 works in non-org buffers. This function is a powerful tool for
469 creating and sorting footnotes. To use it globally, you can add the
470 following keybinding to your =.emacs= file (requires Org 6.17 or
473 : (global-set-key (kbd "C-c f") 'org-footnote-action)
475 For other features you need to switch to Org-mode temporarily, or
476 prepare text in a different buffer.
478 ** Why isn't feature "X" working the way it is described in the manual?
480 :CUSTOM_ID: making-sure-org-mode-is-up-to-date
483 Org-mode develops very quickly. If you are using a version of org-mode
484 that shipped with emacs, there is a good chance that it is somewhat
487 Many of the users on the org-mode mailing list are using either a
488 recent release of org-mode or the
489 [[http://orgmode.org/index.html#sec-3.2][development version of
490 org-mode from the git repository]].
492 If some settings and features aren't working the way you expect, make
493 sure that the version of the manual you are consulting matches the
494 version of org-mode you are using.
496 - You can check which version of org-mode you are using by
497 selection =Org --> Documentation --> Show Version= in the Emacs
500 - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
503 - 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
504 released with the latest official Gnu Emacs release. Compared
505 with the manual at the orgmode.org, the manual at www.gnu.org is
506 somewhat out of date.
508 For instructions on how to stay current with org-mode, consult
509 [[keeping-current-with-Org-mode-development][this FAQ]] or follow the
510 instructions on [[http://orgmode.org][the official org-mode site]].
512 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
514 :CUSTOM_ID: use-visibility-cycling-in-outline-mode
517 Yes, these functions are written in a way that they are independent of
518 the outline setup. The following setup provides standard Org-mode
519 functionality in outline-mode on =TAB= and =S-TAB=. For
520 outline-minor-mode, we use =C-TAB= instead of =TAB=,
521 because =TAB= usually has mode-specific tasks.
523 #+BEGIN_SRC emacs-lisp
524 (add-hook 'outline-minor-mode-hook
526 (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
527 (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
528 (add-hook 'outline-mode-hook
530 (define-key outline-mode-map [(tab)] 'org-cycle)
531 (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
534 Or check out /outline-magic.el/, which does this and also provides
535 promotion and demotion functionality. /outline-magic.el/ is
536 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
538 ** Can I save/restore the visibility state of an org-mode buffer?
542 ** How can I keep track of changes in my Org files?
544 :CUSTOM_ID: track-of-changes-in-Org-files
547 Use git to track the history of the files, use a cronjob to check in
548 changes regularly. Such a setup is described by Bernt Hansen
549 in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
551 ** Can I use Org-mode as the default mode for all README files?
553 :CUSTOM_ID: Org-mode-as-default-mode
556 Add the following to your .emacs file:
558 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
560 You can even make it the default mode for any files with unspecified
563 : (setq default-major-mode 'org-mode)
565 ** Can I use ido.el for completing stuff in Org?
567 :CUSTOM_ID: ido-complete
570 Yes, you can. If you are an ido user and ido-mode is active, the
571 following setting will make Org use =ido-completing-read= for most
572 of its completing prompts.
574 : (setq org-completion-use-ido t)
576 ** Should I use one big org file or multiple files?
578 :CUSTOM_ID: how-to-organize-org-mode-files
581 Org-mode is flexible enough to accomodate a variety of organizational
582 and time management schemes. Org's
583 [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline
584 cycling and convenient editing and navigation commands]] make it
585 possible to maintain all of your projects and notes in a single file.
586 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
587 notes and todos]], also make it a delight to maintain a private "wiki"
588 consisting of multiple files.
590 No matter how you organize your org files, org-mode's agenda commands
591 make it easy to search all your notes and gather together crucial data
594 Moreover, several org-mode settings can be configured either globally
595 in your =.emacs= file or locally (per file or per outline tree). See
596 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
597 see [[limit-agenda-with-category-match][this FAQ]].
599 Here are a few ideas for organizing org-mode files:
601 - A single file for all your projects and notes.
602 - One file per project.
603 - One file per client.
604 - One file per area of responsibility or type of work (e.g.,
605 household, health, work, etc.).
606 - One file for projects, one for appointments, one for reference
607 material, one for someday/maybe items, etc.
608 - A wiki of hyperlinked files that grows and adapts to meet your
611 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
612 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
614 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
616 :CUSTOM_ID: setting-global-keybindings
619 Org-mode has a few global keybindings that the user must set
620 explicitly in an =.emacs= file. These keybindings include the
621 customary shortcut for calling the agenda (=C-c a=). If nothing
622 happens when you type =C-c a=, then make sure that the following lines
623 are in your =.emacs= file:
625 #+BEGIN_SRC emacs-lisp
626 ;; The following lines are always needed. Choose your own keys.
627 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
628 (global-set-key "\C-cl" 'org-store-link)
629 (global-set-key "\C-ca" 'org-agenda)
630 (global-set-key "\C-cb" 'org-iswitchb)
633 You may, of course, choose whatever keybindings work best for you
634 and do not conflict with other modes.
636 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
639 ** Why aren't some of the variables I've customized having an effect?
641 :CUSTOM_ID: load-org-after-setting-variables
644 Some org variables have to be set before org.el is loaded or else they
645 will not work. (An example is the new variable
646 =org-enforce-todo-dependencies=.)
648 To make sure all your variables work you should not use =(require
649 'org)=. Instead use the following setting:
651 : (require 'org-install)
653 You should also make sure that you do not require any other =org-...=
654 files in your =.emacs= file before you have set your org variables,
655 since these will also cause org.el to be loaded. To be safe, load org
656 files *after* you have set your variables.
658 ** How can I make sure that timestamps appear in English?
660 :CUSTOM_ID: timestamps-and-system-time-locale
663 If your system's locale is not set to English, but you would like the
664 timestamps in your org-mode files to appear in English, you can set
665 the following variable:
667 #+begin_src emacs-lisp
668 (setq system-time-locale "C")
671 ** What does a minimal .emacs look like?
672 Using a stripped down minimal .emacs files removes broken custom
673 settings as the cause of an issue and makes it easy to reproduce for
674 other people. The example below has system-specific paths that you'll
675 need to change for your own use.
676 #+begin_src emacs-lisp
677 (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
678 (add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode))
679 (setq org-agenda-files '("/tmp/test.org"))
680 (require 'org-install)
683 (global-set-key "\C-cl" 'org-store-link)
684 (global-set-key "\C-ca" 'org-agenda)
685 (global-set-key "\C-cb" 'org-iswitchb)
688 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
689 configuration code to it, then start emacs something like this:
691 emacs -Q -l ~/minimal.emacs
694 On OS X, starting emacs with minimal configuration might look
697 /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
699 * Errors and general problems
703 ** Opening Org files in Emacs leads to a crash
705 :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
707 The only known case where Org-mode can crash Emacs is when you are
708 using =org-indent-mode= with Emacs 23.1 (in fact, any version of
709 Emacs before version 23.1.50.3). Upgrade to Emacs 23.2 and the
710 problem should go away.
712 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
714 :CUSTOM_ID: wrong-type-argument-keymapp
717 This is a conflict with an outdated version of the /allout.el/, see
718 the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
720 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
722 :CUSTOM_ID: external-application-launched-to-open-file-link
725 If you want special control about how Org-mode opens files, see the
726 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
727 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
729 *However*, normally it is best to just use the mechanism the
730 operating-system provides:
732 *** GNU/Linux systems
733 You you have to check your mailcap settings, find the files:
741 and modify them accordingly. Please read their manual entry.
744 + for html pages you may configure the =browse-url-= variables through
745 the Customize interface,
746 + the pdf files are automatically opened with Acrobat Reader (if it is
750 Change the application responsible for this file type by selecting
751 such a file in the Finder, select =File->Get Info= from the menu
752 and select the application to open this file with. Then, to
753 propagate the change to all files with the same extension, select
754 the =Change all= button.
756 ** Org-mode takes over the TAB key. I also want to use YASnippet, is there a way to fix this conflict?
758 :CUSTOM_ID: YASnippet
761 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs. It is
762 inspired by TextMate's templating syntax.
763 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
764 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
766 *Note*: yasnippet is not compatible with =org-indent-mode= currently
767 there is no known way to use both successfully with =yas/trigger-key=
768 set to =TAB= (or =[tab]= etc...)
770 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
771 =\t=) overrules yasnippets' access to this key. The following code
774 #+begin_src emacs-lisp
775 (add-hook 'org-mode-hook
777 (org-set-local 'yas/trigger-key [tab])
778 (define-key yas/keymap [tab] 'yas/next-field-group)))
781 If the above code doesn't work (which it may not with later versions
782 of yasnippet). Then try the following
784 #+begin_src emacs-lisp
785 (defun yas/org-very-safe-expand ()
786 (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
788 (add-hook 'org-mode-hook
790 ;; yasnippet (using the new org-cycle hooks)
791 (make-variable-buffer-local 'yas/trigger-key)
792 (setq yas/trigger-key [tab])
793 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
794 (define-key yas/keymap [tab] 'yas/next-field)))
797 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]])
798 with YASnippets for Org-mode.
800 ** Org-mode takes over the S-cursor keys. I also want to use CUA-mode, is there a way to fix this conflict?
805 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
807 ** Org-mode takes over the S-cursor keys. I also want to use windmove.el, is there a way to fix this conflict?
809 :CUSTOM_ID: windmove.el
812 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
814 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
816 :CUSTOM_ID: loaded-old-org
819 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=.
821 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.
823 You should add your directories to the =load-path= at the beginning:
825 : (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
827 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)=.
829 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.
831 ** Why doesn't org-batch-agenda work under Win32?
833 :CUSTOM_ID: org-batch-agenda-under-win32
836 When I run the example batch files to print my agenda to the console
837 under Win32 I get the failure:
839 : End of file during parsing
841 and no agenda is printed.
843 The problem is the use of single quotes surrounding the eval in the
844 emacs command-line. This gets confused under Win32. All string
845 parameters with spaces must be surrounded in double quotes. This means
846 that double quotes being passed to the eval must be escaped.
848 Therefore, instead of the following:
850 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
851 : -eval '(org-batch-agenda "a")'
853 you need to use the following:
855 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
856 : -eval "(org-batch-agenda \"a\")"
858 (all on one line, of course).
860 ** Org agenda seems very slow
862 :CUSTOM_ID: slow-agenda
865 If it takes a long time to generate or refresh the agenda, you might
866 want first check which version of org-mode you are using. There have
867 been major optimizations of org-agenda since 6.21b, which was the
868 version of org-mode released with Emacs 23. If you are using 6.21b or
869 earlier (you can check with =M-x org-version=), then you might want to
870 consider upgrading to a more recent version of org-mode.
872 Here are some other ideas for speeding up the agenda:
874 1. Use a one day agenda view (rather than a seven day view).
876 =(setq org-agenda-ndays 1)=
878 2. Archive inactive items to separate files.
880 =C-c C-x C-s= (org-archive-subtree)
882 3. Do not include the global todo list in your agenda view.
884 (setq org-agenda-include-all-todo nil)
886 4. Make sure that your org files are byte-compiled.
888 I.e., make sure there are files ending in .elc in your org
889 installation directory.
891 ** Visual-line-mode doesn't work well with org-mode
893 :CUSTOM_ID: visual-line-mode
896 Visual-line-mode "soft wraps" lines so that the visual edge of the
897 buffer is considered a line break for purposes of navigation, even
898 though there is no line break in reality.
900 In older versions of org-mode, org-beginning-of-line and
901 org-end-of-line do not work well with visual line mode. (The two
902 commands disregard soft line breaks and move to the beginning and end
903 of the hard line break.) A patch was introduces to fix this behavior
906 If you are using an older version of org mode, you can:
908 1. Add a hook to turn off visual line mode.
910 2. Add the following to your =.emacs=:
912 #+begin_src emacs-lisp
914 (add-hook 'org-mode-hook
916 (define-key org-mode-map "\C-a" 'move-beginning-of-line)
917 (define-key org-mode-map "\C-e" 'move-end-of-line)))
920 * Faces and highlighting
924 ** Org-mode has a lot of colors? How can I change them?
926 :CUSTOM_ID: customizing-org-faces
929 This is a question that applies to Emacs as a whole, but it comes up
930 quite frequently on the org-mode mailing list, so it is appropriate to
933 If you would like to change the style of a face in org-mode (or any
934 other Emacs mode), simply type =M-x customize-face [RET]= while the
935 cursor is on the color/style you are interested in modifying. You will
936 be given the opportunity to customize all the faces located at that
939 If you would like an overview of all the faces in org-mode, you can
940 type =C-u M-x list-faces-display [RET] org= and you will be shown all
941 the faces defined by org-mode along with an illustration of their
944 If you would like to customize org-faces and other aspects of
945 org-appearance, type =M-x customize-group org-font-lock [RET]=.
947 Finally, if you would like verbose information about the properties of
948 the text under the cursor, you can type =C-u C-x ==.
950 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
951 ** Why do I get a tiny font in column view when using emacs daemon?
953 :CUSTOM_ID: column-view-tiny-font
956 When using emacs in daemon mode (=emacs --daemon=), client frames
957 sometimes override the column view face settings, resulting in very
958 small fonts. Here is a fix:
960 #+begin_src emacs-lisp
961 (defun org-column-view-uses-fixed-width-face ()
962 ;; copy from org-faces.el
963 (when (fboundp 'set-face-attribute)
964 ;; Make sure that a fixed-width face is used when we have a column
966 (set-face-attribute 'org-column nil
967 :height (face-attribute 'default :height)
968 :family (face-attribute 'default :family))))
970 (when (and (fboundp 'daemonp) (daemonp))
971 (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
974 This fix was provided in the following mailing list post:
976 http://article.gmane.org/gmane.emacs.orgmode/27560
977 ** How can I stop the mouse cursor from highlighting lines in the agenda?
979 :CUSTOM_ID: ratpoison-for-agenda-highlighting
982 You can add the following to your =.emacs=:
984 #+begin_src emacs-lisp
985 (add-hook 'org-finalize-agenda-hook
986 (lambda () (remove-text-properties
987 (point-min) (point-max) '(mouse-face t))))
994 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
996 :CUSTOM_ID: indirect-buffers
999 You may use /indirect buffers/ which do exactly this. See the
1000 documentation on the command =make-indirect-buffer=.
1002 Org-mode has built-in commands that allow you create an indirect
1003 buffer from a subtree of an outline. To open a subtree in new
1004 window, type =C-c C-x b=. Any changes you make in the new window
1005 will be saved to the original file, but the visibility of both
1006 buffers will remain independent of one another.
1008 For multiple indirect buffers from the same file, you must use the
1009 prefix =C-u= when creating the second (or third) buffer. Otherwise
1010 the new indirect buffer will replace the old.
1012 You can also create an independent view of an outline subtree by
1013 typing =b= on an item in the agenda.
1015 ** Emacs outlines are unreadable. Can I get rid of all those stars?
1017 :CUSTOM_ID: Emacs-outlines-are-unreadable
1020 See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1021 ** C-k is killing whole subtrees! I lost my work!
1023 :CUSTOM_ID: C-k-is-killing-subtrees
1026 =(setq org-special-ctrl-k t)= before losing your work.
1028 ** Why aren't commands working on regions?
1030 :CUSTOM_ID: transient-mark-mode
1033 Some org-mode commands, such as M-right and M-left for demoting or
1034 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1035 These commands, however, will only work on active regions set with
1036 [[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
1037 Emacs 23. To enable it in earlier versions of emacs, put the following
1038 in your =.emacs= file:
1040 : (transient-mark-mode 1)
1042 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1043 momentary mark]] (=C-<SPC> C-<SPC>=).
1045 ** Why is a blank line inserted after headlines and list items?
1047 :ID: 2463F4D8-F686-4CF3-AA07-08976F8A4972
1050 :CUSTOM_ID: blank-line-after-headlines-and-list-items
1053 In org-mode, typing =M-RET= at the end of a headline will create a new
1054 headline of the same level on a new line. The same is true for plain
1055 lists. By default org-mode uses context to determine if a blank line
1056 should be inserted after each headline or plain list item when =M-RET=
1057 is pressed. For instance, if a there is a blank line before a
1058 headline, then typing =M-RET= at the end of the line will insert a
1059 blank line before the new headline. For instance, hitting =M-RET=
1060 at the end of "Headline Two" below inserts a new headline without a
1067 If there is a blank line between Headline One and Headline Two,
1068 however, the results will be as follows:
1076 If you do not like the default behavior you can change it with the
1077 variable =org-blank-before-new-entry=. You can set headings and/or
1078 plain lists to auto (the default setting), t (always), or nil (never).
1080 ** How can I promote or demote multiple headlines at once?
1082 :CUSTOM_ID: demote-multiple-headlines
1085 If you have a long list of first level headlines that you'd like to
1086 demote to second level headlines, you can select the headlines as a
1087 region and then hit =M-<right>= to demote all the headlines at once.
1089 Note: =M-S-<right>= will not work on a selected region. Its use is to
1090 demote a single subtree (i.e., a headline and all sub-headlines).
1092 If M-<right> doesn't seem to work, make sure transient mark mode is
1093 enabled. See [[transient-mark-mode][this FAQ]].
1095 ** What's the deal with all the ellipses in my org outlines?
1097 :CUSTOM_ID: org-ellipses
1100 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1101 commonly, ellispes occur at the end of headings with folded content:
1105 Or, for instance, they may indicate closed drawers:
1109 Sometimes, as a result of editing and cycling an outline, ellipses may
1110 appear in unexpected places. You should *never* delete these ellipses,
1111 as you may accidentally delete hidden text. Instead, you can type =C-c
1112 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1113 may type =M-x RET show-all= to reveal all text in the org file.
1115 If you would prefer a symbol or face for indicating hidden text, you
1116 can customize the variable org-ellipses.
1118 ** How do I yank a subtree so it's indented according to points' location?
1120 :CUSTOM_ID: yank-indent-subtree
1123 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1125 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1126 yanked headline's level correctly.
1128 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1130 ** Can I read org-mode outlines in vim?
1132 :CUSTOM_ID: org-outlines-in-vim
1135 Yes, there is a script that enables one to view and navigate folded
1136 outline/org files in vim (though without most of org-mode's
1137 functionality, of course).
1139 - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1141 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1146 :CUSTOM_ID: Todos-and-Tags
1148 ** How can I cycle through the TODO keyword of an entry?
1150 :CUSTOM_ID: cycle-TODO-keywords
1153 =C-c C-t= or =S-<left/right>= is what you need.
1155 ** How do I track state changes for tasks in Org?
1157 :CUSTOM_ID: track-state-changes-for-tasks
1160 Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1161 states and logging timestamps for task state changes.
1163 ** Can I select the TODO keywords with a tag-like interface?
1165 :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1168 Yes. Use =(setq org-use-fast-todo-selection t)=
1170 If you want to set both your todos and your tags using a single
1171 interface, then check out the variable
1172 =org-fast-tag-selection-include-todo=.
1174 See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1176 ** How can I quickly set the tag of an entry?
1178 :CUSTOM_ID: quickly-set-tag-of-entry
1181 Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1182 setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1183 keybinding for filing a note from the remember buffer.
1185 You can set tags even more quickly by setting one of the character
1186 shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1188 To set tag shortcuts for all org buffers, put something like the
1189 following in your =.emacs= file (or create the same settings by
1190 typing =M-x customize-variable RET org-tag-alist=):
1192 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1194 To set tag shortcuts for a single buffer, put something like the
1195 following at the top of your org file:
1197 : #+TAGS: computer(c) office(o) home(h)
1199 ** How can I change the colors of TODO keywords?
1201 You can use the variable org-todo-keyword-faces. Here are some sample
1204 #+begin_src emacs-lisp
1205 (setq org-todo-keyword-faces
1207 ("TODO" . (:foreground "firebrick2" :weight bold))
1208 ("WAITING" . (:foreground "olivedrab" :weight bold))
1209 ("LATER" . (:foreground "sienna" :weight bold))
1210 ("PROJECT" . (:foreground "steelblue" :weight bold))
1211 ("DONE" . (:foreground "forestgreen" :weight bold))
1212 ("MAYBE" . (:foreground "dimgrey" :weight bold))
1213 ("CANCELED" . shadow)
1217 If you want to change the color of all active todos or all inactive
1220 : M-x customize-face RET org-todo
1221 : M-x customize-face RET org-done
1223 You can also set values for each of these in your =.emacs= file:
1225 : (set-face-foreground 'org-todo "firebrick2")
1226 : (set-face-foreground 'org-done "forestgreen")
1230 :CUSTOM_ID: Hyperlinks
1232 ** Why do I have to confirm the execution of each shell/elisp link?
1234 :CUSTOM_ID: confirm-shell/elisp-link
1237 The confirmation is there to protect you from unwantingly execute
1238 potentially dangerous commands. For example, imagine a link
1240 : [[shell:rm -rf ~/*][Google Search]]
1242 In an Org-mode buffer, this command would look like /Google Search/,
1243 but really it would remove your home directory. If you wish, you can
1244 make it easier to respond to the query by setting
1246 : (setq org-confirm-shell-link-function 'y-or-n-p
1247 : org-confirm-elisp-link-function 'y-or-n-p).
1249 Then a single keypress will be enough to confirm those links. It is
1250 also possible to turn off this check entirely, but I strongly
1251 recommend against this. Be warned.
1253 ** Can I use RET or TAB to follow a link?
1255 :CUSTOM_ID: RET-or-TAB-to-follow-link
1260 : (setq org-return-follows-link t)
1261 : (setq org-tab-follows-link t)
1263 ** Can I keep mouse-1 clicks from following a link?
1265 :CUSTOM_ID: mouse-1-following-link
1268 Activating links with =mouse-1= is a new feature in Emacs 22, to make
1269 link behavior similar to other applications like web browsers. If
1270 you hold the mouse button down a bit longer, the cursor will be set
1271 without following the link. If you cannot get used to this behavior,
1272 you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1273 link activation for =mouse-1= with
1275 : (setq org-mouse-1-follows-link nil)
1277 ** How can I get completion of file names when creating a link?
1279 :CUSTOM_ID: completion-of-file-links
1282 You can use org-insert-link with a prefix argument:
1286 You will be greeted with prompt in the minibuffer that allows for file
1287 completion using your preferred Emacs method for finding files.
1289 ** How can I use invisible targets within lists?
1291 The usual way of turning radio links invisible is to comment them, but
1292 Org comments need to be at the beginning of the line, which breaks list
1295 The workaround here is to add (INVISIBLE) after your <<target>>
1299 : 11. <<target>>(INVISIBLE)
1301 : 12. More text [[target][go to]]
1305 :CUSTOM_ID: Plain-Lists
1307 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1309 :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1312 : (setq org-blank-before-new-entry
1313 : '((heading . t) (plain-list-item . nil))
1315 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1317 ** How can I convert itemized lists to enumerated lists?
1319 :CUSTOM_ID: convert-itemized-to-enumerated-lists
1322 You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1323 bullet headlines available for lists: =-, +, *, 1., 1)=.
1325 See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1327 ** How can I convert plain lists to headlines and vice versa?
1329 :CUSTOM_ID: convert-plain-lists-to-headlines
1332 To convert a plain list item or line to a headline, type =C-c *= on
1333 the headline. This will make the line a subheading of the current
1336 To convert a headline to a plain list item, type =C-c -= while the
1337 cursor is on the headline.
1339 To convert a headline to an unadorned line of text, type =C-c *= on
1342 You can use query replace to accomplish the same things, as Bernt
1343 Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1345 ** Is there a good way to create a description list?
1347 :CUSTOM_ID: description-lists
1350 Yes, these are now built-in:
1353 - item1 :: Description of this item 1
1354 - item2 :: Description of this item 2
1355 - item1 :: Description of this item 3
1356 also in multiple lines
1363 ** How can I make table alignment work with Asian character sets
1365 :CUSTOM_ID: table-alignment-asian-characters
1368 When table alignment fails, it usually has to do with character sets
1369 where some characters have non-integer width. Org will deal correctly
1370 with characters that are one or two or three ASCII characters wide,
1371 but not with characters that are, for example, 1.5 ASCII characters
1372 wide. To make table alignment work you need to switch to a different
1375 ** Can I plot data from a table?
1377 :CUSTOM_ID: plotting-table-data
1380 Yes, you can, using org-plot.el written by Eric Schulte and now
1381 bundled with Org. See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1383 See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1385 ** How can I fill a table column with incremental numbers?
1387 :CUSTOM_ID: fill-table-column-with-incremental-numbers
1390 Here is how: Use a field formula to set the first value in the column:
1402 Then define a column formula in the second field:
1414 After recomputing the table, the column will be filled with
1415 incremental numbers:
1424 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1427 Note that you could use arbitrary starting values and column formulas.
1429 ** Why does my table column get filled with #ERROR?
1431 :CUSTOM_ID: table-column-filled-with-ERROR
1434 Org-mode tried to compute the column from other fields using a
1435 formula stored in the =#+TBLFM:= line just below the table, and
1436 the evaluation of the formula fails. Fix the fields used in the
1437 formula, or fix the formula, or remove it!
1439 ** How can I stop the table editor from creating new lines?
1441 :CUSTOM_ID: table-editor-creates-new-lines
1444 When I am in the last column of a table and just above a horizontal
1445 line in the table, pressing TAB creates a new table line before the
1446 horizontal line. To move to the line below the
1447 horizontal line instead, do this:
1449 Press =down= (to get on the separator line) and then =TAB=.
1450 Or configure the variable
1452 : (setq org-table-tab-jumps-over-hlines t)
1454 ** How can I get table fields starting with "="?
1456 :CUSTOM_ID: table-fields-starting-with-=
1461 : (setq org-table-formula-evaluate-inline nil)
1463 this will no longer happen. You can still use formulas using the
1464 commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1466 ** How can I change the indentation of an entire table without fixing every line by hand?
1468 :CUSTOM_ID: change-indentation-entire-table
1471 The indentation of a table is set by the first line. So just fix the
1472 indentation of the first line and realign with =TAB=.
1474 ** In my huge table the realigning after each TAB takes too long. What can I do?
1476 :CUSTOM_ID: table-realigning-after-TAB-takes-long
1479 Either split the table into several by inserting an empty line every
1480 100 lines or so. Or turn off the automatic re-align with
1482 : (setq org-table-automatic-realign nil)
1484 After this the only way to realign a table is to press =C-c C-c=. It
1485 will no longer happen automatically, removing the corresponding delays
1488 ** Recalculation of my table takes too long. What can I do?
1490 :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1493 Nothing, really. The spreadsheet in org is mostly done to make
1494 calculations possible, not so much to make them fast. Since Org-mode
1495 is firmly committed to the ASCII format, nothing is stopping you from
1496 editing the table by hand. Therefore, there is no internal
1497 representation of the data. Each time Org-mode starts a computation,
1498 it must scan the table for special lines, find the fields etc. This
1499 is slow. Furthermore, Calc is slow compared to hardware
1500 computations. To make this work with normal editing, recalculation
1501 is not happening automatically, or only for the current line, so that
1502 the long wait for a full table iteration only happens when you ask
1505 So for really complex tables, moving to a "real" spreadsheet may
1506 still be the best option.
1508 That said, there are some ways to optimize things in Org-mode, and I
1509 have been thinking about moving a bit further down this line.
1510 However, for my applications this has so far not been an issue at
1511 all. If you have a good case, you could try to convince me.
1513 ** =S-RET= in a table keeps increasing the copied numbers. How can I stop this?
1515 :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1518 Well, it is /supposed/ to be a feature, to make it easy to create a
1519 column with increasing numbers. If this gets into your way, turn it
1522 : (setq org-org-table-copy-increment nil)
1524 ** When I export tables to html, they don't have borders.
1526 :CUSTOM_ID: table-borders-in-html-export
1529 By default, org mode exports tables without borders.
1531 You can changed this by placing an =#+ATTR_HTML= line before the
1534 : #+ATTR_HTML: border="2" rules="all" frame="all"
1536 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1538 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1540 :CUSTOM_ID: table-high-precision
1546 : | 0.16666667000000 |
1547 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1549 : | 0.16666666666667 |
1550 : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1554 It is important to distinguish between the precision of
1555 1) =p20=: Calc internal calculation (=calc-internal-prec=)
1556 2) =f14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1557 3) =%.14f=: the =printf= reformatting, limited in precision
1559 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.
1561 Use =C-h v org-calc-default-modes RET= to check the Org default settings
1562 which are used if no format specifiers are added to a table formula.
1563 The examples below have been made with the out_of_the_box Org defaults
1564 =calc-internal-prec = 12= and =calc-float-format = 8=.
1566 Remember the formula debugger, toggled with =C-c {=,
1567 to view the processing stages like:
1568 | | formula debugger label | processing stage |
1570 |---+------------------------+----------------------------|
1571 | | Result: | output of Calc |
1572 | | Format: | reformatting with =printf= |
1574 Following are some examples to demonstrate
1575 the interaction of the three precisions.
1577 - *display precision limitations for Calc formulas*
1578 - limited by Calc internal calculation precision from Org default
1580 : | 0.16666666666700 |
1581 : #+TBLFM: $1 = 1 / 2 * 3; f14
1583 : | 0.1666666666670000000 |
1584 : #+TBLFM: $1 = 1 / 2 * 3; f19
1586 - limited by Calc float format from Org default (here =f8=)
1588 : #+TBLFM: $1 = 1 / 2 * 3
1591 : #+TBLFM: $1 = 1 / 2 * 3; p20
1593 : | 0.16666667000000 |
1594 : #+TBLFM: $1 = 1 / 2 * 3; %.14f
1596 : | 0.16666667000000 |
1597 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1599 - limited by Calc float format specified
1601 : #+TBLFM: $1 = 1 / 2 * 3; f6
1603 : | 0.16666666666667 |
1604 : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1606 : | 0.1666666666666666667 |
1607 : #+TBLFM: $1 = 1 / 2 * 3; p20 f19
1609 - limited by =printf= conversion to Emacs Lisp float
1610 : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1611 : #+TBLFM: $1 = 1 / 2 * 3; %.19f
1613 : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1614 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.19f
1616 : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1617 : #+TBLFM: $1 = 1 / 2 * 3; p20 f20 %.19f
1619 - limited by =printf= format specified
1621 : #+TBLFM: $1 = 1 / 2 * 3; %.6f
1623 - *display precision limitations for Emacs Lisp formulas*
1624 - limited by Emacs Lisp float
1625 : | 0.16666666666666666 |
1626 : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1628 : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1629 : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1631 - limited by =printf= format specified
1632 : | 0.16666666666667 |
1633 : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1635 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1636 and is continued in the [[#table-float-fraction][next FAQ entry]].
1638 ** Which float format shows the fraction part also when the latter is zero?
1640 :CUSTOM_ID: table-float-fraction
1647 : #+TBLFM: $1 = 1 + 0; f3
1650 : #+TBLFM: $1 = 1 + 0; %.3f
1654 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]]
1655 in the section Mode Settings -> Display Modes -> Float Formats
1656 [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is kept]].
1658 Remember the formula debugger, toggled with =C-c {=,
1659 to view the processing stages like:
1660 | | formula debugger label | processing stage |
1662 |---+------------------------+----------------------------|
1663 | | Result: | output of Calc |
1664 | | Format: | reformatting with =printf= |
1666 Following are some examples to demonstrate different float formats.
1669 : |----------------------+---------+-------+-------|
1670 : | number | f3 | f-3 | %.3f |
1671 : |----------------------+---------+-------+-------|
1672 : | 1 + 0 | 1 | 1 | 1.000 |
1673 : | 0 + 0 | 0 | 0 | 0.000 |
1674 : |----------------------+---------+-------+-------|
1675 : | 1 + 1 / 2 * 3 * 1000 | 1.000 | 1.000 | 1.000 |
1676 : | 0 + 1 / 2 * 3 * 1000 | 1.67e-4 | 0.000 | 0.000 |
1677 : |----------------------+---------+-------+-------|
1678 : | 1 + 1 / 2 * 3 * 100 | 1.002 | 1.002 | 1.002 |
1679 : | 0 + 1 / 2 * 3 * 100 | 0.002 | 0.002 | 0.002 |
1680 : |----------------------+---------+-------+-------|
1681 : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1; %.3f
1684 : |----------------------+--------------------------+-----------------------|
1685 : | number | f19 | f-19 |
1686 : |----------------------+--------------------------+-----------------------|
1689 : |----------------------+--------------------------+-----------------------|
1690 : | 1 + 1 / 2 * 3 * 1e19 | 1.0000000000000000000 | 1.0000000000000000000 |
1691 : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1692 : |----------------------+--------------------------+-----------------------|
1693 : | 1 + 1 / 2 * 3 * 1e18 | 1.0000000000000000002 | 1.0000000000000000002 |
1694 : | 0 + 1 / 2 * 3 * 1e18 | 0.0000000000000000002 | 0.0000000000000000002 |
1695 : |----------------------+--------------------------+-----------------------|
1696 : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1698 The =printf= reformatting (=%.19f=) cannot be used with high precision,
1699 see the [[#table-high-precision][previous FAQ entry]].
1701 ** How can I center tables in LaTeX output?
1703 Set the `org-export-latex-tables-centered' to `t':
1705 : (defcustom org-export-latex-tables-centered t
1706 : "When non-nil, tables are exported in a center environment."
1707 : :group 'org-export-latex
1712 :CUSTOM_ID: Footnotes
1714 ** How can I get automatic renumbering of footnotes in org-mode?
1716 :CUSTOM_ID: footnote-auto-adjust
1719 You can add the following line to your .emacs file:
1721 : (setq org-footnote-auto-adjust t)
1723 Or, if you prefer, you can turn this option on locally by placing the
1724 following line at the top of your org file:
1726 : #+STARTUP: fnadjust
1728 When auto-adjust is turned on, footnotes in the file with numerical
1729 labels will be renumbered whenever a new footnote is added. Meanwhile,
1730 all footnotes, including those with custom labels such
1731 =[fn:custom-label ]=, will be sorted in the order of their appearance
1734 This emulates the footnote behavior that many users may be familiar
1735 with from word-processing programs or from the footnote-mode included
1738 If you do not turn on org-footnote-auto-adjust, you sort and/or
1739 renumber footnotes at any time by calling org-footnote-action with a
1742 ** Why isn't auto renumbering of footnotes turned on by default?
1744 :CUSTOM_ID: why-no-default-auto-adjust
1747 Org mode has a very robust footnote mechanism allowing for a variety
1748 of types of footnotes. With some of the following footnote notations,
1749 auto-adjust may be either irrelevant or undesired:
1751 - Automatically numbered
1752 - Footnotes with custom labels
1755 In addition, org mode can be customized to place footnotes either at
1756 the end of a document or at the end of the outline heading in which
1757 they appear. Users who change this setting while editing a document
1758 may be disconcerted to find all of their footnotes rearranged
1761 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1763 :CUSTOM_ID: auto-fill-and-unwanted-comments
1766 If the following occurs:
1776 Make sure that the variable comment-start is nil.
1778 ** Are there any shortcuts for entering source blocks and comment lines?
1780 :CUSTOM_ID: shortcuts-for-entering-source-blocks
1783 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
1784 and lines of code in a file. (This is especially useful when exporting
1785 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
1790 , print "Hello, world!\n";
1794 It can be tiresome to enter the block comment lines manually. There
1795 are several possible shortcuts you can use to enter them:
1797 1) Built-in expansion
1799 - Org mode has a "secret" method of expanding source code blocks
1802 - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
1805 - For a full list of expansions, type =M-x describe-variable
1806 [RET] org-structure-template-alist=.
1808 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
1810 - Add the following line to your emacs file:
1812 =(set-register ?p "#+begin_src\n\n#+end_src perl")=
1814 - Then type =C-x r i p= to insert the source block. Please note: if
1815 you save another value to the register "p" with =C-x r s p=, it
1816 will overwrite the setting above for the current emacs session.
1818 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
1820 - Activate the abbrev minor-mode in org-mode:
1826 + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
1828 - In org-mode, type "sbp" (a sample abbreviation for a perl source
1831 - Immediately after "sbp" type =C-x a i l=.
1833 - Enter the expansion:
1835 - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
1837 - Note: =C-q C-j= creates a new line in the minibuffer
1839 - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
1840 org-mode buffer, the src block will magically appear.
1842 - To review your list of abbrevs, type =M-x edit-abbrevs=.
1844 - If you want more complex completion (like yasnippet) you can combine
1845 abbrev mode with [[http://www.emacswiki.org/emacs/SkeletonMode][skeletons]].
1847 4) [[http://code.google.com/p/yasnippet/][Yasnippet]]
1849 - Several org-mode users install yasnippet for convenient, complex
1852 - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
1855 * Capture and remember
1857 :CUSTOM_ID: Remember
1860 ** Can I use a variable or a function inside the `org-capture-templates' variable?
1862 Yes. Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
1864 E.g. if you have a variable called =org-test-file= and you want the
1865 variable =org-capture-templates= to "understand" (i.e. evaluate)
1866 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
1867 [...])= expression, use backquotes like this:
1869 #+begin_src emacs-lisp
1870 (setq org-capture-templates
1871 `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
1872 "* TODO %?\n %i\n %a")
1873 ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
1877 ** Can I use the remember buffer to clock a customer phone call?
1879 :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
1882 Yes, you can. Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
1883 and check out (in the same thread) what Nick Docos had to fix to
1884 make Bernt's set-up work for him.
1885 ** Can I automatically start the clock when opening a remember template?
1887 :CUSTOM_ID: start-clock-when-opening-remember-template
1890 Yes, this is possible. Use the following code and make sure that
1891 after executing it, `my-start-clock-if-needed' is in
1892 `remember-mode-hook' /after/ `org-remember-apply-template'.
1894 : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
1895 : (defun my-start-clock-if-needed ()
1897 : (goto-char (point-min))
1898 : (when (re-search-forward " *CLOCK-IN *" nil t)
1899 : (replace-match "")
1902 Then, when a template contains the key string CLOCK-IN, the clock
1903 will be started. Starting with Org-mode version 5.20, the clock will
1904 automatically be stopped when storing the remember buffer.
1908 :CUSTOM_ID: Searches
1910 ** Isearch does not find string hidden in links. What can I do?
1912 :CUSTOM_ID: isearch-in-links
1915 M-x =visible-mode= will display the full link, making them searchable.
1917 ** How can I reduce the amount of context shown in sparse trees?
1919 :CUSTOM_ID: context-in-sparse-trees
1922 Take a look at the following variables:
1924 - =org-show-hierarchy-above=
1925 - =org-show-following-headline=
1926 - =org-show-siblings=
1927 - =org-show-entry-blow=
1929 which give command-dependent control over how much context is shown
1930 by a particular operation.
1932 ** How can I combine the results of two calls to =org-occur=?
1934 :CUSTOM_ID: two-calls-to-org-occur
1937 You can construct a regular expression that matches all targets you
1938 want. Alternatively, use a =C-u= prefix with the second and any
1939 further calls to =org-occur= to keep the current visibility and
1940 highlighting in addition to the new ones.
1946 ** How can I change the advanced warning time for deadlines?
1947 ##<<warning-period-for-deadlines>>
1949 Deadline warnings appear in the daily agenda view a specified number
1950 of days before the deadline is due. The default setting is 14 days.
1951 You can change this with the variable =org-deadline-warning-days=.
1952 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
1956 : (setq org-deadline-warning-days 30)
1958 would cause warnings for each deadline to appear 30 days in advance.
1960 Naturally, you might not want warnings for all of your deadlines to
1961 appear so far in advance. Thus, you can change the lead time for
1962 individual items as follows:
1964 : * TODO Get a gift for the party
1965 : DEADLINE: <2009-01-16 Fri -2d>
1967 The "-2d" above changes the lead time for this deadline warning to two
1968 days in advance. You can also use "w" for weeks and "m" for months.
1969 ** How can I postpone a task until a certain date?
1971 :CUSTOM_ID: deferring-tasks
1974 The easiest way to postpone a task is to schedule it in the future.
1975 For instance, typing =C-c C-s +2w= on a headline will push a task two
1976 weeks into the future, so that it won't show up on the daily agenda
1977 until two weeks from now.
1979 If you'd like to prevent the task from showing up on your global todo
1980 list, you have a couple of options.
1982 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
1983 This will exclude any scheduled items from your global list of
1984 active todos (=C-c a t=). (The variable
1985 =org-agenda-todo-ignore-with-date= will exclude both scheduled and
1986 deadline items from your todo list).
1987 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
1988 item will still appear on your agenda two weeks from today, but it
1989 won't show up on your todo lists.
1990 ** Can I send myself an email containing tasks or other agenda info?
1992 :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
1995 Yes. See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
1997 ** How can I limit the agenda view to my "work" tasks?
1999 :CUSTOM_ID: limit-agenda-with-tag-filtering
2002 It is often convenient to group org files into separate categories,
2003 such as "home" and "work" (or "personal" and "professional"). One
2004 of the main reasons for such classification is to create agenda
2005 views that are limited by type of work or area of responsibility.
2006 For instance, while at work, one may want to see only professional
2007 tasks; while away from work, one may want to see only personal
2010 One way to categorize files and tasks is to use a "#+FILETAGS"
2011 declaration at the top of each file, such as:
2015 As long as org-use-tag-inheritance is turned on, the filetags will
2016 be inherited by all tasks in the file. A file can have multiple
2017 filetags. And, of course, tags can be added to individual headings.
2019 Tasks can be quickly filtered by tag from within the agenda by
2020 typing "/" and the name of the tag. The full key sequence to filter
2021 for work items in an agenda view would be:
2023 : C-c a a / work [or a tag shortcut]
2025 ** How can I limit the agenda view to a particular category?
2027 :CUSTOM_ID: limit-agenda-with-category-match
2030 Another way to filter agenda views by type of work is to use a
2031 "#+CATEGORY" declaration at the top of each file, such as:
2035 Categories can also be added to individual headings within a file:
2042 All todos belonging to the category "work" can be found a with a
2043 simple tags-todo search:
2047 At the prompt, type:
2051 The same results can be achieved with custom agenda commands, such as:
2053 #+BEGIN_SRC emacs-lisp
2054 (setq org-agenda-custom-commands
2055 '(("h" tags-todo "CATEGORY=\"home\"")
2056 ("w" tags-todo "CATEGORY=\"work\"")
2057 ;; other custom agenda commands here
2061 ** How can include all org files in a directory in my agenda?
2063 :CUSTOM_ID: set-agenda-files-using-wildcards
2066 You can simply include the directory (as one of the items) in the
2067 value of the variable org-agenda-files:
2069 : (setq org-agenda-files '("/my/special/path/org/"))
2071 There is another way of accomplishing the same end:
2073 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2075 ** Why aren't items disappearing from my agenda once they are marked done?
2077 :CUSTOM_ID: removing-done-items-from-agenda
2080 If items remain on your daily/weekly agenda after they are marked
2081 done, check the configuration of the following variables:
2083 : org-agenda-skip-scheduled-if-done
2084 : org-agenda-skip-deadline-if-done
2085 : org-agenda-skip-timestamp-if-done
2089 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2091 If this variable is turned off (=nil=), then scheduled items will
2092 remain on the agenda even after they are marked done.
2094 If the variable is turned on (=t=), then scheduled items will
2095 disappear from the agenda after they are marked done.
2097 If these settings seem not to behave the way you expect, then make
2098 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2099 difference between SCHEDULED, DEADLINE, and timestamps]].
2101 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2103 :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2106 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2107 the day they are scheduled and on every day thereafter until they
2108 are done. Schedule a task if you want to be reminded to do
2109 something beginning on a certain day and until it is done.
2111 : ** TODO Scheduled item
2112 : SCHEDULED: <2009-03-01 Sun>
2114 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2115 agenda in advance of the when they are due and remain on your
2116 agenda until they are done. Add a DEADLINE to an item if you want
2117 to make sure to complete it by a certain date. (The variable
2118 org-deadline-warning-days determines how far in advance items with
2119 deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2122 : ** TODO Item with a deadline
2123 : DEADLINE: <2009-01-20 Tue>
2125 3. An active timestamp (set with =C-c .=) will appear on your agenda
2126 only on the day it is scheduled. Use a timestamp for appointments
2127 or any reminders you want to show up only on a particular day.
2129 : ** TODO Item with an active timestamp
2132 Note: items with inactive timestamps (set with C-c ! and marked by
2133 square brackets) will not show up in the agenda at all.
2135 ** Can I add files recursively to my list of agenda files?
2137 :CUSTOM_ID: set-agenda-files-recursively
2140 Yes, you can use the library "find-lisp."
2142 : (load-library "find-lisp")
2143 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2145 This will add all files ending in =org= in the directory "~/org"
2146 and all of its subdirectories to your list of agenda files.
2148 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2150 ** Why does an item appearing at the wrong time of day in my agenda?
2152 :CUSTOM_ID: agenda-wrong-time-of-day
2155 When preparing the agenda view, org-mode scans each relevant headline
2156 for a time designation. This approach is very nice for adding
2157 free-form timestamps to an item for scheduling. Thus, either of the
2158 following work would work to schedule an item at 10:00am:
2161 ,** 10:00am Get dried ice at the magic store
2162 , SCHEDULED: <2009-05-27 Wed>
2166 ,** Get dried ice at the magic store
2167 , SCHEDULED: <2009-05-27 Wed 10:00>
2170 To enable this flexibility, org-mode scans the entire headline for
2171 time of day notation. A potential problem can arise if you use
2172 inactive timestamps in the headline to note when an item was created.
2176 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2177 , SCHEDULED: <2009-05-27 Wed>
2180 Org mode would interpret the time in the inactive timestamp as a
2181 time-of-day indicator and the entry would appear in your agenda at
2184 If you would like to turn off the time-of-day search, you can
2185 configure the variable =org-agenda-search-headline-for-time= (requires
2188 ** How can I change the visibility of an item from the agenda?
2190 :CUSTOM_ID: cycling-visibility-from-agenda
2193 You can add a keybinding as follows:
2195 #+begin_src emacs-lisp
2196 (add-hook 'org-agenda-mode-hook
2198 (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2201 Then, as you press SPACE on an item on the agenda, it will cycle the
2202 visibility of its original location.
2204 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2206 See the =org-agenda-remove-tags= variable.
2208 * Appointments/Diary
2210 :CUSTOM_ID: Appointments/Diary
2212 ** Is it possible to include entries from org-mode files into my emacs diary?
2214 :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2217 Since the org-mode agenda is much more powerful and can contain the
2218 diary, you should think twice before deciding to do this. If you
2219 insist, however, integrating Org-mode information into the diary is
2220 possible. You need to turn on /fancy diary display/ by setting in
2223 : (add-hook 'diary-display-hook 'diary-fancy-display)
2225 Then include the following line into your ~/diary file, in
2226 order to get the entries from all files listed in the variable
2231 You may also select specific files with
2233 : &%%(org-diary) ~/path/to/some/org-file.org
2234 : &%%(org-diary) ~/path/to/another/org-file.org
2236 If you now launch the calendar and press @<tt>d@</tt> to display a
2237 diary, the headlines of entries containing a timestamp, date range,
2238 schedule, or deadline referring to the selected date will be listed.
2239 Just like Org-mode's agenda view, the diary for /today/ contains
2240 additional entries for overdue deadlines and scheduled items. See
2241 also the documentation of the =org-diary= function. Under XEmacs, it
2242 is not possible to jump back from the diary to the org, this works
2243 only in the agenda buffer.
2244 ** I want to add my Org scheduled/deadlined entries in my diary!
2246 :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2249 Put this in your ~/.diary:
2251 : &%%(org-diary :scheduled :timestamp :deadline)
2253 ** How can I set up automatic reminders based on Org information?
2255 :CUSTOM_ID: automatic-reminders
2258 See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2259 ** How can I make =appt= notice my Org appointments?
2261 :CUSTOM_ID: appt-notice-my-Org-appointments
2264 : M-x org-agenda-to-appt RET
2266 ** How can I create more complex appointments in my org-files?
2268 :CUSTOM_ID: diary-sexp-in-org-files
2271 Org-mode's active timestamps work very well for scheduling individual
2272 or recurring appointments, such as:
2275 ,* 8:00am Dentist appointment <2009-01-16 Fri>
2281 , <2009-03-20 Fri>--<2009-04-01 Wed>
2287 ,* Weekly meeting with boss
2288 , <2009-01-20 Tue 14:00 +1w>
2291 Sometimes, however, you need to set up more complicated recurring
2292 appointments. Org-mode has built-in support for many of
2293 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2294 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
2295 instance, that you teach a class that meets every Monday evening
2296 between February 16 and April 20, 2009. The way to enter this an
2300 ,** Class 7:00pm-9:00pm
2301 , <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2304 The expression above designates all Mondays that fall between February
2305 16 and April 20. How exactly does it work?
2307 - (and... :: Indicates that *both* of the conditions that follow have
2310 - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2313 - Note: the function calendar-day-of-week converts the date to the day of week
2314 expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2316 - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2319 You can make a sexp as complex as you like. If you wanted to omit a
2320 week because of holidays, for instance, you could add another
2321 condition to the sexp:
2324 ,** Class 7:00pm-9:00pm
2325 , <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2328 The sexp above would omit Monday during the week of March 9, 2009. For
2329 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2331 Another diary function commonly used for more complex scheduling is
2332 diary-float. For instance,
2336 , <%%(diary-float t 3 3)>
2339 ...would appear on the third Wednesday of every month.
2341 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2342 page on the Emacs wiki]].
2344 ** How can I schedule a weekly class that lasts for a limited period of time?
2346 :CUSTOM_ID: org-diary-class
2350 Org-mode offers a convenient diary sexp function for setting up a
2351 recurring appointment that lasts for a certain period of time, such as
2352 a class. It is called org-diary-class and it can be entered as
2356 ,** Class 7:00pm-9:00pm
2357 , <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2360 The function above schedules an appointment for every Monday (1)
2361 between February 16 and April 20, 2009, except for ISO week 10 (March
2364 The function org-diary-class has the following format:
2366 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2368 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2369 takes the form of a number indicating the day of the week (0 = Sunday,
2370 1 = Monday, and so on...). In addition, one can add an optional
2371 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2372 skipped. This argument should be expressed as an ISO week number. You
2373 can find the number by invoking emacs' built-in calendar (=M-x
2374 calendar=), navigating to the appropriate week, and typing =p c=
2375 (calendar-iso-print-date).
2379 For example, say you are taking night classes in Spanish. The class is every
2380 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks. AFAIK
2381 Org's timestamps do not support limited occurrences of recurrent items -- you
2382 have to schedule the item with infinite recurrences, then delete it when it
2385 To schedule the Spanish classes, put the following in your =.emacs=:
2387 #+begin_src emacs-lisp
2388 (defun diary-limited-cyclic (recurrences interval m d y)
2389 "For use in emacs diary. Cyclic item with limited number of recurrences.
2390 Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2391 RECURRENCES occasions."
2392 (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2393 (today (calendar-absolute-from-gregorian date)))
2394 (and (not (minusp (- today startdate)))
2395 (zerop (% (- today startdate) interval))
2396 (< (floor (- today startdate) interval) recurrences))))
2398 The item in the org file looks like this:
2401 ,** 19:00-21:00 Spanish lessons
2402 , <%%(diary-limited-cyclic 8 7 8 18 2010)>
2404 [Source: Paul Sexton's post on Org-mode mailing list.]
2406 ** How can I set an event to occur every day except Saturday and Sunday?
2410 , <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2413 ** How do I schedule events relative to Easter Sunday?
2415 Easter's date moves around from year to year according to a
2416 complicated set of criteria which I do not claim to understand.
2417 However the following code will allow you to schedule recurring
2418 events relative to Easter Sunday.
2420 Note: the function da-easter is from:
2421 http://github.com/soren/elisp/blob/master/da-kalender.el
2423 Put the following in your .emacs:
2425 #+begin_src emacs-lisp
2426 (defun da-easter (year)
2427 "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2428 Gregorian calendar, ie (MM DD YY) format."
2429 (let* ((century (1+ (/ year 100)))
2430 (shifted-epact (% (+ 14 (* 11 (% year 19))
2431 (- (/ (* 3 century) 4))
2432 (/ (+ 5 (* 8 century)) 25)
2435 (adjusted-epact (if (or (= shifted-epact 0)
2436 (and (= shifted-epact 1)
2437 (< 10 (% year 19))))
2440 (paschal-moon (- (calendar-absolute-from-gregorian
2443 (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
2446 (defun da-easter-gregorian (year)
2447 (calendar-gregorian-from-absolute (da-easter year)))
2449 (defun calendar-days-from-easter ()
2450 "When used in a diary sexp, this function will calculate how many days
2451 are between the current date (DATE) and Easter Sunday."
2452 (- (calendar-absolute-from-gregorian date)
2453 (da-easter (calendar-extract-year date))))
2456 Now we can schedule the public holidays associated with Easter as
2457 recurring events. Good Friday is 2 days before "Easter", Easter
2458 Monday is one day after.
2462 , <%%(= -2 (calendar-days-from-easter))>
2465 , <%%(= 0 (calendar-days-from-easter))>
2468 , <%%(= 1 (calendar-days-from-easter))>
2470 [Source: Posted by Paul Sexton on Org-mode mailing list.]
2472 ** How to schedule public holiday that is "the nearest Monday to DATE"?
2474 In New Zealand each regional capital has an "Anniversary Day". The
2475 date of Auckland's anniversary day is "the nearest Monday to 29
2478 Put this in your =.emacs=:
2480 #+begin_src emacs-lisp
2481 (defun calendar-nearest-to (target-dayname target-day target-month)
2482 "Recurring event that occurs in the nearest TARGET-DAYNAME to
2483 the date TARGET-DAY, TARGET-MONTH each year."
2485 (let* ((dayname (calendar-day-of-week date))
2486 (target-date (list target-month target-day (calendar-extract-year date)))
2487 (days-diff (abs (- (calendar-day-number date)
2488 (calendar-day-number target-date)))))
2489 (and (= dayname target-dayname)
2493 Now we can schedule Auckland Anniversary Day. The first argument,
2494 1, means Monday (days of the week are numbered starting with
2497 [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
2499 ** How to schedule public holiday on "the 4th Monday in October"?
2501 This does not require any additions to =.emacs=:
2505 , <%%(diary-float 10 1 4)>
2512 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2514 :CUSTOM_ID: export-TODO-items-as-lists
2517 If you plan to use ASCII or HTML export, make sure things you want to
2518 be exported as item lists are level 4 at least, even if that does
2519 mean there is a level jump. For example:
2521 : * Todays top priorities
2522 : **** TODO write a letter to xyz
2523 : **** TODO Finish the paper
2524 : **** Pick up kids at the school
2526 Alternatively, if you need a specific value for the heading/item
2527 transition in a particular file, use the =#+OPTIONS= line to
2528 configure the H switch.
2530 : #+OPTIONS: H:2; ...
2532 ** Can I export only a single subtree?
2534 :CUSTOM_ID: export-single-subtree
2537 If you want to export a subtree, mark the subtree as region and then
2538 export. Marking can be done with =C-c @ C-x C-x=, for example.
2540 ** How can I tell my calendar web application about appointments in my agenda files?
2542 Here is what you need to do:
2544 1. a script that calls Emacs in batch mode and produce a .ics file
2545 2. a script that uploads this .ics file somewhere on the web
2546 3. tell your webapp to fetch this .ics file on the web
2548 Here is the script I use for the first step:
2550 #+begin_src shell-script-mode
2553 /usr/local/bin/emacs --batch --eval \
2554 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2555 (load-file \"~/elisp/config/org-batch-config.el\") \
2556 (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2557 (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2558 -f org-export-icalendar-combine-agenda-files
2561 Depending on your configuration, you might change the load sequence.
2563 Here is the script I use for the second step:
2565 #+begin_src shell-script-mode
2567 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2570 Note: if you want to cron this rsync script, you will need to let
2571 =my_server= to know about your SSH public key. Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2574 Now you can cron the two scripts above and your webapp will always be
2575 up to date with your Org agendas.
2577 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2579 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2581 :CUSTOM_ID: iCal-import-ics-files-old
2584 When using iCal under Apple MacOS X Tiger, you can create a new
2585 calendar /OrgMode/ (the default name for the calendar created by =C-c
2586 C-e c=, see the variables =org-icalendar-combined-name= and
2587 =org-combined-agenda-icalendar-file=). Then set Org-mode to
2588 overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2589 You may even use AppleScript to make iCal re-read the calendar files
2590 each time a new version of /OrgMode.ics/ is produced. Here is the
2591 setup needed for this:
2593 : (setq org-combined-agenda-icalendar-file
2594 : "~/Library/Calendars/OrgMode.ics")
2595 : (add-hook 'org-after-save-iCalendar-file-hook
2598 : "osascript -e 'tell application \"iCal\" to reload calendars'")))
2600 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2602 :CUSTOM_ID: iCal-import-ics-files-new
2605 For Mac OS X 10.4, you need to write the ics file to
2606 =/Library/WebServer/Documents/= and then subscribe iCalendar to
2607 =http: //localhost/orgmode.ics=
2609 ** How can I remove timestamps and todo keywords from my exported file?
2611 :CUSTOM_ID: export-options-remove-timestamps
2614 You can place an options line at the top of your org file:
2616 : #+OPTIONS: <:nil todo:nil
2618 There is a whole host of export options you can set with an in-buffer
2619 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2622 ** How can I preserve faces when I export an agenda from the command line?
2624 :CUSTOM_ID: preserving-faces-during-batch-export
2627 Normally, when you export an org file or an agenda view from within
2628 emacs, htmlize will convert your face definitions to direct color css
2629 styles inlined into each =<span>= object, resulting in an HTML output
2630 that preserves the general look of your Org buffers and agenda views.
2632 Let's say you generate an export from the command line, such as the
2635 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2639 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2641 In such an instance, the exported HTML will contain only very basic
2642 color styles. The reason is that when Emacs is run in batch mode, it
2643 does not have a display and therefore only rudimentary face
2644 definitions. If you'd like to use more complex styles, you'll have to
2645 make sure that the export process only assigns classes instead of
2646 direct color values. This can be done by binding the variable
2647 =org-export-htmlize-output-style= to =css= for the duration of the
2648 export, for example with
2650 : emacs -batch -l ~/.emacs
2651 : -eval '(let ((org-export-htmlize-generate-css (quote css)))
2652 : (org-batch-agenda "e"))'
2654 Then you can use a style file to make these classes look any way you
2655 like. To generate face definitions for a CSS file based on any faces
2656 you are currently using in Emacs, you can use the following command:
2658 : M-x org-export-htmlize-generate-css RET
2660 This will generate a =<style>...</style>= section, the content of
2661 which you can add to your style file.
2663 ** How can I avoid dark color background when exporting agenda to ps format?
2665 :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2668 Add this to your .emacs and evaluate it.
2670 #+BEGIN_SRC emacs-lisp
2671 (setq org-agenda-exporter-settings
2672 '((ps-print-color-p 'black-white)))
2675 ** How can I get colored source code when exporting to LaTeX?
2677 :CUSTOM_ID: fontified_source_code_w_latex
2680 As of Sun Aug 9 2009 the "current" version of Org-mode (see
2681 [[keeping-current-with-Org-mode-development]]) supports exporting source
2682 code to LaTeX using the listings package.
2684 To turn on listing export add the following to your Org-mode
2686 #+begin_src emacs-lisp
2687 ;; requite org-latex so that the following variables are defined
2688 (require 'org-latex)
2690 ;; tell org to use listings
2691 (setq org-export-latex-listings t)
2693 ;; you must include the listings package
2694 (add-to-list 'org-export-latex-packages-alist '("" "listings"))
2696 ;; if you want colored source code then you need to include the color package
2697 (add-to-list 'org-export-latex-packages-alist '("" "color"))
2700 The listings package will now be used to fontify source code in your
2701 LaTeX documents. By default listings will not color any of your
2702 source code. If you would like to set colors for keywords and
2703 comments in your latex documents you can do so using LaTeX directives
2706 \lstset{keywordstyle=\color{blue},
2707 commentstyle=\color{red},
2708 stringstyle=\color{green}
2712 of if you want to get even fancier with your colors you can try
2713 something like the following
2715 \definecolor{keywords}{RGB}{255,0,90}
2716 \definecolor{comments}{RGB}{60,179,113}
2717 \definecolor{fore}{RGB}{249,242,215}
2718 \definecolor{back}{RGB}{51,51,51}
2720 basicstyle=\color{fore},
2721 keywordstyle=\color{keywords},
2722 commentstyle=\color{comments},
2723 backgroundcolor=\color{back}
2727 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
2729 ** How can I export to Latex Beamer
2733 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
2734 The following can be used to export Org-mode documents to LaTeX
2737 Add the following to your Emacs initialization file.
2738 #+begin_src emacs-lisp
2739 (unless (boundp 'org-export-latex-classes)
2740 (setq org-export-latex-classes nil))
2741 (add-to-list 'org-export-latex-classes
2743 "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
2744 ("\\section{%s}" . "\\section*{%s}")
2745 ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
2746 "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
2750 : #+LaTeX_CLASS: beamer
2751 in the header of your Org-mode document it will automatically export
2752 to the Beamer document class on LaTeX export. With the above
2753 configuration top-level headers will be mapped to sections in the
2754 Beamer document, second-level headers will be mapped to frames, and
2755 lower level headlines will be mapped to itemize objects.
2757 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
2758 Thomas Dye]]. For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
2761 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
2763 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents. It
2764 aids in creation of bibliographies, cross-references, indexes, and
2765 glossaries. RefTeX understands the structure of multi-file LaTeX
2766 documents and is able to collect from them information about the
2767 location(s) of external data stores used in creation of the final
2768 document. RefTeX was written by Carsten Dominik and is currently
2769 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
2771 *** Using RefTeX In Org-mode Files for LaTeX Export
2772 In Org-mode files for LaTeX export, the trick is to find a way to tell
2773 RefTeX the locations of external data stores. One way is to set the
2774 variable, =reftex-default-bibliography=. Add lines like these to
2777 #+begin_src emacs-lisp
2778 (setq reftex-default-bibliography
2780 ("default.bib" "other-default.bib")))
2783 In practice, this is a limited solution and the
2784 typical user will want to pass this information on a per-file basis.
2785 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
2788 The first solution, proposed by Mario, enables the RefTeX citation
2789 function in Org-mode. Add these lines to .emacs:
2791 #+begin_src emacs-lisp
2792 (defun org-mode-reftex-setup ()
2793 (load-library "reftex")
2794 (and (buffer-file-name)
2795 (file-exists-p (buffer-file-name))
2797 (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
2798 (add-hook 'org-mode-hook 'org-mode-reftex-setup)
2801 Then add the following lines anywhere in the Org-mode file (Org-mode
2802 will recognize them as LaTeX commands):
2805 \bibliographystyle{plain}
2806 \bibliography{BIB-NAME}
2809 With this setup, =C-c )= will invoke =reftex-citation= which will
2810 insert a reference in the usual way:
2815 ,This is a citation \cite{tierney90}.
2817 ,\bibliographystyle{plain}
2821 This Org-mode file will export the following LaTeX output:
2823 #+begin_src latex :exports code
2824 % Created 2010-03-22 Mon 14:34
2825 \documentclass[11pt,letter]{article}
2826 \usepackage[utf8]{inputenc}
2827 \usepackage[T1]{fontenc}
2828 \usepackage{hyperref}
2832 \date{2010-03-22 Mon}
2838 \setcounter{tocdepth}{3}
2842 \section{test reftex}
2846 This is a citation \cite{tierney90}.
2848 \bibliographystyle{plain}
2855 A second solution, to activate the RefTeX minor mode on a per-file
2856 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
2857 Add the following lines to .emacs:
2859 #+begin_src emacs-lisp
2860 (add-hook ‘org-mode-hook
2862 (if (member “WRITE” org-todo-keywords-1)
2863 (org-mode-article-modes))))
2866 where =org-mode-article-modes= is defined as follows:
2868 #+begin_src emacs-lisp
2869 (defun org-mode-article-modes ()
2871 (bib-cite-minor-mode t)
2872 (and (buffer-file-name)
2873 (file-exists-p (buffer-file-name))
2874 (reftex-parse-all)))
2877 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
2878 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
2882 ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
2885 With this setup, you insert a citation with =M-x reftex-citation RET=.
2887 *** Using RefTeX in Org-babel LaTeX Code Blocks
2889 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
2890 information in other Org-babel LaTeX code blocks. If you use an Emacs
2891 starter kit where configuration information is held in Org-mode files,
2892 then the second solution is preferable because you won't be asked for
2893 a master file when Emacs is started. For this reason, the second
2894 solution is modified for use with Org-babel latex code blocks. No
2895 key-binding is needed here because Org-babel code blocks are edited
2896 within the usual AucTeX environment.
2898 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]])
2899 #+begin_src emacs-lisp
2900 (defun org-mode-article-modes ()
2902 (and (buffer-file-name)
2903 (file-exists-p (buffer-file-name))
2904 (reftex-parse-all)))
2906 (add-hook 'org-mode-hook
2908 (if (member "REFTEX" org-todo-keywords-1)
2909 (org-mode-article-modes))))
2912 Then add a line like the following line to the top of your org-mode file:
2915 ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
2918 When you open an org-mode file with a line like this, RefTeX will
2919 prompt for the master .tex file, which will be parsed in the usual
2920 way. This means that the .tex file should already exist, perhaps by
2921 tangling the LaTeX preamble and postamble, before
2922 =org-mode-article-modes= is activated for the Org-mode file.
2924 ** Why is my exported PDF file almost unreadable?
2926 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
2927 possibly others) do not get along with Adobe Type3 fonts, producing
2928 almost unreadable screen output (printed output is OK). If you see
2929 this, first verify the fonts that your document uses: open it with
2930 Acrobat Reader or Evince, select "Properties" from the "File" menu and
2931 click on the "Fonts" tab; alternatively, you can use the pdffonts
2932 program (part of the xpdf-reader package) from the command line. If
2933 that is indeed the problem, then either use a different viewer or
2934 install Type1 versions of the problematic fonts. For more details, see
2935 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
2937 ** Can I add attributes to a link or an image in HTML export?
2939 Yes. Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
2941 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
2942 In the example below we specify the `alt' and `title' attributes to
2943 support text viewers and accessibility, and align it to the right.
2945 : #+CAPTION: A black cat stalking a spider
2946 : #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
2949 and you could use `http' addresses just as well.
2953 ** Which versions of MobileOrg do exist
2955 :CUSTOM_ID: mobileorg_versions
2958 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
2959 Richard Moreland. Check out
2960 [[http://mobileorg.ncogni.to/][Richard's page]]
2961 - Matt Jones is developing a feature-equivalent application for
2963 [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
2965 ** What can I do if I don't want to use Dropbox.com
2967 :CUSTOM_ID: mobileorg_webdav
2970 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
2971 you can get a free account there. If for some reason you cannot or do
2972 not want to use this path, you can use any webdav server. On this
2973 webdav server you need to create a dedicated directory for the
2974 communication between Emacs and MobileOrg. If you can mount that
2975 directory locally so that Emacs can directly write to it, just point
2976 to that directory using the variable =org-mobile-directory=. Using
2977 the /tramp/ method, =org-mobile-directory= may point to a remote
2978 directory accessible through, for example, /ssh/ and /scp/:
2980 #+begin_src emacs-lisp
2981 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
2984 If Emacs cannot access the WebDAV directory directly using a /tramp/
2985 method, you can use a local directory for staging. Other means must
2986 then be used to keep this directory in sync with the WebDAV directory.
2987 In the following example, files are staged in =~/stage/=, and Org-mode
2988 hooks take care of moving files to and from the WebDAV directory using
2991 #+begin_src emacs-lisp
2992 (setq org-mobile-directory "~/stage/")
2993 (add-hook 'org-mobile-post-push-hook
2994 (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
2995 (add-hook 'org-mobile-pre-pull-hook
2996 (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
2997 (add-hook 'org-mobile-post-pull-hook
2998 (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3001 * COMMENT HTML style specifications
3003 #+begin_src emacs-lisp
3004 (defun org-faq-make-target ()
3005 "Make hard target for current headline."
3007 (if (not (org-on-heading-p))
3008 (error "Not on a headline"))
3009 (let ((h (org-trim (org-get-heading 'no-tags))))
3010 (if (string-match "[ \t]*\\?\\'" h)
3011 (setq h (replace-match "" t t h)))
3012 (while (string-match "[ \t]+" h)
3013 (setq h (replace-match "-" t t h)))
3014 (org-entry-put nil "CUSTOM_ID" h)))