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:info toc:1 path:http://orgmode.org/worg/code/org-info-js/org-info.js tdepth:1 ftoc:t buttons:0 mouse:underline
8 #+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
10 [[file:index.org][{Back to Worg's index}]]
17 Welcome to the Org-mode FAQ.
19 You can navigate the FAQ by clicking on any of the topics in the Table
22 If your browser supports JavaScript, you can...
24 - move through the topics by typing "=n=" (next) and "=p=" (previous).
26 - see an outline view of the FAQ by typing "=m=" or clicking "=toggle
29 - search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
31 - see a full list of navigation commands by typing "=?=" or clicking
36 :CUSTOM_ID: What-is-org-mode
38 ** Can I implement a GTD workflow with Org-mode?
40 :CUSTOM_ID: GTD-workflow-with-Org-mode
43 Yes, you can. Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.php][here]].
45 ** What is the difference between Org and TaskPaper?
47 :CUSTOM_ID: Org-and-TaskPaper
50 There is really no difference. Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]]. It
51 is just that, when using Org within Emacs, it lets you do many things
52 that you wouldn't be able to do with TaskPaper. Yes, TaskPaper is
53 fiddle-proof and people using Emacs tends to like fiddling (which is
54 orthogonal to the idea of using todo-list efficiently), but this is
55 just a matter of discipline and common sense, not one of Org's design.
57 Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
58 ** What is the meaning of the Unicorn on Org's website?
63 The Unicorn is the logo of Org-mode because:
65 - Org-mode is the UNICs of ORgaNizers.
67 - Org-mode is an Emacs mode, so it makes sense to use an animal
68 /somehow/ similar or related to the gnu used for GNU Emacs.
70 - Org-mode is meant to show you the way, and an animal with two horns
71 can not do this very well, can it?
73 - Unicorn tears are said to reverse petrification, and wasn't this how
74 we all felt before getting to some degree of time and task
77 - It will take forever to learn everything there is to know about a
80 - A unicorn is a fabulous creature. Org-mode wants to be a fabulous
83 - A unicorn can lose a fight against the lion and still live to save
84 the day when the witches strike (/Stardust/ by Neil Gaiman).
86 Using a unicorn was /Bastien Guerry's/ idea, and his friend
87 /Christophe Bataillon/ designed the logo for us. Bastien
88 writes why he chose a unicorn:
91 The first reason is not linked to the animal, but to the sounding of the
92 word "Unicorn" - because Org gives you a /uni/que way of producing files
93 in several format (HTML, LaTeX, etc.)
95 The second reason is that a Unicorn doesn't really exist, it is just
96 something you can dream about, and make others believe it does exist.
97 Just like the perfect organizer.
100 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
101 Suckling]] posted a link showing how to make a simple foldable unicorn
102 (very appropriate for an outlining program!).
103 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very compilcated one which is now treasured by the
106 #+CAPTION: Folded unicorn. Made, and dedicated to Org-mode, by Tim Burt
107 [[http://farm4.static.flickr.com/3374/3319131381_b5bb2040fd.jpg]]
111 :CUSTOM_ID: Keeping-current
113 ** How do I keep current with Org mode development?
115 :CUSTOM_ID: keeping-current-with-Org-mode-development
118 Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org
119 mode developement by cloning Org mode repository and refreshing
120 your copy with latest changes whenever you wish. You only need to
121 use two Git commands (clone and pull.) Here are the steps in
122 brief (please customize locations to suit your setup):
124 1. Select a location to house the Org mode repository (approx. 40
125 MB; includes documentation, compiled elisp files and history
126 going all the way back to v4.12a)
128 : $ mkdir $HOME/elisp && cd $HOME/elisp
130 2. Clone the Org mode Git repository.
132 Recommended approach:
134 : $ git clone git://repo.or.cz/org-mode.git
136 Alternate approach if you are behind a firewall that allows only
137 HTTP (can be quite slow):
139 : $ git clone http://repo.or.cz/r/org-mode.git
141 3. Compile and install Org mode and build documentation.
143 : $ cd org-mode && make && make doc && make install
145 Please note that you can choose to /not/ compile at all and run
146 using source =.el= files only. Compiled files speed things up.
148 4. This is where you configure Org mode with Emacs. Please refer
149 to [[./org-tutorials/index.org][Org tutorials]].
151 5. Keeping up-to-date.
153 Cloning the repository is a one time activity. From this point
154 onwards you only need to /pull/ the latest changes.
156 : $ cd $HOME/elisp/org-mode
160 : $ git pull && make clean && make && make doc && make install
162 6. You should restart org mode to have the changes take effect (if
163 you are not rebooting Emacs.) Also since the intention is to
164 "keep up" with Org mode, you should visit ChangeLog and updated
165 sections of documentation for latest updates (use =git log=.)
167 7. As you use your repository over time it will accumulate loose objects.
168 You can reduce the total size of your git repository with
172 which will consolidate loose git objects into pack files. This
173 reduces the size of the repository and speeds up data access to
176 ** How can I keep local changes and still track Org mode development?
178 :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
181 Say you want to make minor changes to the Makefile to reflect your
182 location for =emacs=.
184 Create a local branch for your changes on top of origin/master as
187 : $ git checkout -b local origin/master
188 : $ git config branch.local.rebase true
189 : # Make your changes to the Makefile and create a new commit
191 : $ git commit -m 'My local Makefile configurations'
192 : # Update git to a newer version
195 Now each time you pull new commits from the distribution repository
196 your local commits will be rewound and replayed on top of the new
201 You would normally work on your =local= branch which includes your
202 custom commits; there's no need to switch back to the =master=
207 Here is an example of dealing with conflict resolution during git pull.
209 If you get a conflict during a =git pull= you will need to edit the
210 file with the conflict to fix up the conflicting lines and then tell
211 git that you have resolved the conflict.
213 Conflict resolution goes something like this:
215 1. =git pull= fails with a conflict
217 3. =git add= the file to mark the conflict resolved
218 4. =git rebase --continue=
219 5. lather, rinse, and repeat 2-4 as needed
221 For this example we have the following Makefile:
231 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
232 make it work well on our system.
236 - create a local branch for our work
238 : $ git checkout -b local origin/master
239 : $ git config branch.local.rebase true
241 This marks the branch so that all local commits on it are rebased
242 on top of any new commits we get in origin/master during a =git
245 - Make our custom changes
247 Edit the makefile so it looks like this:
257 - Create a commit with our custom changes
259 : $ git commit -m 'My local Makefile configurations'
261 - Later we do a =git pull= but that fails with conflicts.
264 : remote: Counting objects: 5, done.
266 : Patch failed at 0001.
268 : When you have resolved this problem run "git rebase --continue".
269 : If you would prefer to skip this patch, instead run "git rebase --skip".
270 : To restore the original branch and stop rebasing run "git rebase --abort".
272 - Fix the conflict in your favourite editor
274 Conflict markers look like this:
276 : <<<<<<< HEAD:Makefile
280 : >>>>>>> Change emacs location:Makefile
282 This attempted =git pull= caused a conflict. Fire up your
283 favourite editor and fix the conflict in the Makefile. The
284 conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>. Fix
285 the Makefile appropriately and delete the conflict markers. You
286 already edited these lines earlier so fixing it should be trivial.
288 In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
289 upstream changed =EMACS=emacs= to =EMACS=emacs22=. Just fix the
290 file and save it by deleting the conflict markers and keeping the
291 code you need (in this case the =EMACS=myemacs= line which we
292 originally modified.)
294 - Mark the file's conflict resolved
298 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.
300 - Continue the rebase operation
302 : $ git rebase --continue
304 If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
306 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"
308 : $ git rebase --abort
314 ** Can I use the editing features of org-mode in other modes?
316 :CUSTOM_ID: use-editing-features-in-other-modes
319 Not really---but there are a few editing features you can use in
322 - For tables there is =orgtbl-mode= which implements the table
323 editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
324 - For ordered lists there is =orgstuct-mode= which allows for easy
325 list editing as a minor mode. (To enable, type =M-x
328 You can activate these modes automatically by using hooks:
330 : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
331 : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
333 For footnotes, there is the function =org-footnote-action=, which
334 works in non-org buffers. This function is a powerful tool for
335 creating and sorting footnotes. To use it globally, you can add the
336 following keybinding to your =.emacs= file (requires Org 6.17 or
339 : (global-set-key (kbd "C-c f") 'org-footnote-action)
341 For other features you need to switch to Org-mode temporarily, or
342 prepare text in a different buffer.
344 ** Why isn't feature "X" working the way it is described in the manual?
346 :CUSTOM_ID: making-sure-org-mode-is-up-to-date
349 Org-mode develops very quickly. There have been a great many changes,
350 for instance, since the release of Emacs 22, which shipped with
351 version 4.67d of org-mode. (Emacs 23 is expected to ship with version
354 Many of the users on the org-mode mailing list are using either a
355 recent release of org-mode or the
356 [[http://orgmode.org/index.html#sec-3.2][development version of
357 org-mode from the git repository]].
359 If some settings and features aren't working the way you expect, make
360 sure that the version of the manual you are consulting matches the
361 version of org-mode you are using.
363 - You can check which version of org-mode you are using by
364 selection =Org --> Documentation --> Show Version= in the Emacs
367 - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
370 - 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
371 released with the latest official Gnu Emacs release (Emacs 22 and
372 org-mode 4.67d as of February 2009). Note: compared with the
373 manual at the orgmode.org, the manual at www.gnu.org is
374 considerably out of date.
376 For instructions on how to stay current with org-mode, consult [[keeping-current-with-Org-mode-development][this
377 FAQ]] or follow the instructions on [[http://orgmode.org][the official org-mode site]].
379 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
381 :CUSTOM_ID: use-visibility-cycling-in-outline-mode
384 Yes, these functions are written in a way that they are independent of
385 the outline setup. The following setup provides standard Org-mode
386 functionality in outline-mode on =TAB= and =S-TAB=. For
387 outline-minor-mode, we use =C-TAB= instead of =TAB=,
388 because =TAB= usually has mode-specific tasks.
390 #+BEGIN_SRC emacs-lisp
391 (add-hook 'outline-minor-mode-hook
393 (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
394 (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
395 (add-hook 'outline-mode-hook
397 (define-key outline-mode-map [(tab)] 'org-cycle)
398 (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
401 Or check out /outline-magic.el/, which does this and also provides
402 promotion and demotion functionality. /outline-magic.el/ is
403 available at [[http://www.astro.uva.nl/~dominik/Tools/OutlineMagic][Outline Magic]].
405 ** How can I keep track of changes in my Org files?
407 :CUSTOM_ID: track-of-changes-in-Org-files
410 Use git to track the history of the files, use a cronjob to check in
411 changes regularly. Such a setup is described by Bernt Hansen
412 in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
414 ** Can I use Org-mode as the default mode for all README files?
416 :CUSTOM_ID: Org-mode-as-default-mode
419 Add the following to your .emacs file:
421 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
423 You can even make it the default mode for any files with unspecified
426 : (setq default-major-mode 'org-mode)
428 ** Can I use ido.el for completing stuff in Org?
430 :CUSTOM_ID: ido-complete
433 Yes, you can. If you are an ido user and ido-mode is active, the
434 following setting will make Org use =ido-completing-read= for most
435 of its completing prompts.
437 : (setq org-completion-use-ido t)
439 ** Should I use one big org file or multiple files?
441 :CUSTOM_ID: how-to-organize-org-mode-files
444 Org-mode is flexible enough to accomodate a variety of organizational
445 and time management schemes. Org's
446 [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline
447 cycling and convenient editing and navigation commands]] make it
448 possible to maintain all of your projects and notes in a single file.
449 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
450 notes and todos]], also make it a delight to maintain a private "wiki"
451 consisting of multiple files.
453 No matter how you organize your org files, org-mode's agenda commands
454 make it easy to search all your notes and gather together crucial data
457 Moreover, several org-mode settings can be configured either globally
458 in your =.emacs= file or locally (per file or per outline tree). See
459 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
460 see [[limit-agenda-with-category-match][this FAQ]].
462 Here are a few ideas for organizing org-mode files:
464 - A single file for all your projects and notes.
465 - One file per project.
466 - One file per client.
467 - One file per area of responsibility or type of work (e.g.,
468 household, health, work, etc.).
469 - One file for projects, one for appointments, one for reference
470 material, one for someday/maybe items, etc.
471 - A wiki of hyperlinked files that grows and adapts to meet your
474 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
475 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
477 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
479 :CUSTOM_ID: setting-global-keybindings
482 Org-mode has a few global keybindings that the user must set
483 explicitly in an =.emacs= file. These keybindings include the
484 customary shortcut for calling the agenda (=C-c a=). If nothing
485 happens when you type =C-c a=, then make sure that the following lines
486 are in your =.emacs= file:
488 #+BEGIN_SRC emacs-lisp
489 ;; The following lines are always needed. Choose your own keys.
490 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
491 (global-set-key "\C-cl" 'org-store-link)
492 (global-set-key "\C-ca" 'org-agenda)
493 (global-set-key "\C-cb" 'org-iswitchb)
496 You may, of course, choose whatever keybindings work best for you
497 and do not conflict with other modes.
499 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
502 ** Why aren't some of the variables I've customized having an effect?
504 :CUSTOM_ID: load-org-after-setting-variables
507 Some org variables have to be set before org.el is loaded or else they
508 will not work. (An example is the new variable
509 =org-enforce-todo-dependencies=.)
511 To make sure all your variables work you should not use =(require
512 'org)=. Instead use the following setting:
514 : (require 'org-install)
516 You should also make sure that you do not require any other =org-...=
517 files in your =.emacs= file before you have set your org variables,
518 since these will also cause org.el to be loaded. To be safe, load org
519 files *after* you have set your variables.
525 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
527 :CUSTOM_ID: wrong-type-argument-keymapp
530 This is a conflict with an outdated version of the /allout.el/, see
531 the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
533 ** Org-mode takes over the S-cursor keys. I also want to use CUA-mode, is there a way to fix this conflict?
538 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
540 ** Org-mode takes over the S-cursor keys. I also want to use windmove.el, is there a way to fix this conflict?
542 :CUSTOM_ID: windmove.el
545 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
547 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
549 :CUSTOM_ID: loaded-old-org
552 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=.
554 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.
556 You should add your directories to the =load-path= at the beginning:
558 : (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
560 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)=.
562 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.
564 ** Why doesn't org-batch-agenda work under Win32?
566 :CUSTOM_ID: org-batch-agenda-under-win32
569 When I run the example batch files to print my agenda to the console
570 under Win32 I get the failure:
572 : End of file during parsing
574 and no agenda is printed.
576 The problem is the use of single quotes surrounding the eval in the
577 emacs command-line. This gets confused under Win32. All string
578 parameters with spaces must be surrounded in double quotes. This means
579 that double quotes being passed to the eval must be escaped.
581 Therefore, instead of the following:
583 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
584 : -eval '(org-batch-agenda "a")'
586 you need to use the following:
588 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
589 : -eval "(org-batch-agenda \"a\")"
591 (all on one line, of course).
597 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
599 :CUSTOM_ID: indirect-buffers
602 You may use /indirect buffers/ which do exactly this. See the
603 documentation on the command =make-indirect-buffer=.
605 Org-mode has built-in commands that allow you create an indirect
606 buffer from a subtree of an outline. To open a subtree in new
607 window, type =C-c C-x b=. Any changes you make in the new window
608 will be saved to the original file, but the visibility of both
609 buffers will remain independent of one another.
611 For multiple indirect buffers from the same file, you must use the
612 prefix =C-u= when creating the second (or third) buffer. Otherwise
613 the new indirect buffer will replace the old.
615 You can also create an independent view of an outline subtree by
616 typing =b= on an item in the agenda.
618 ** Emacs outlines are unreadable. Can I get rid of all those stars?
620 :CUSTOM_ID: Emacs-outlines-are-unreadable
623 See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
624 ** C-k is killing whole subtrees! I lost my work!
626 :CUSTOM_ID: C-k-is-killing-subtrees
629 =(setq org-special-ctrl-k t)= before losing your work.
631 ** Why aren't commands working on regions?
633 :CUSTOM_ID: transient-mark-mode
636 Some org-mode commands, such as M-right and M-left for demoting or
637 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
638 These commands, however, will only work on active regions set with
639 [[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
640 Emacs 23. To enable it in earlier versions of emacs, put the following
641 in your =.emacs= file:
643 : (transient-mark-mode 1)
645 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
646 momentary mark]] (=C-<SPC> C-<SPC>=).
648 ** Why is a blank line inserted after headlines and list items?
650 :ID: 2463F4D8-F686-4CF3-AA07-08976F8A4972
653 :CUSTOM_ID: blank-line-after-headlines-and-list-items
656 In org-mode, typing =M-RET= at the end of a headline will create a new
657 headline of the same level on a new line. The same is true for plain
658 lists. By default org-mode uses context to determine if a blank line
659 should be inserted after each headline or plain list item when =M-RET=
660 is pressed. For instance, if a there is a blank line before a
661 headline, then typing =M-RET= at the end of the line will insert a
662 blank line before the new headline. For instance, hitting =M-RET=
663 at the end of "Headline Two" below inserts a new headline without a
670 If there is a blank line between Headline One and Headline Two,
671 however, the results will be as follows:
679 If you do not like the default behavior you can change it with the
680 variable =org-blank-before-new-entry=. You can set headings and/or
681 plain lists to auto (the default setting), t (always), or nil (never).
683 ** How can I promote or demote multiple headlines at once?
685 :CUSTOM_ID: demote-multiple-headlines
688 If you have a long list of first level headlines that you'd like to
689 demote to second level headlines, you can select the headlines as a
690 region and then hit =M-<right>= to demote all the headlines at once.
692 Note: =M-S-<right>= will not work on a selected region. Its use is to
693 demote a single subtree (i.e., a headline and all sub-headlines).
695 If M-<right> doesn't seem to work, make sure transient mark mode is
696 enabled. See [[transient-mark-mode][this FAQ]].
700 :CUSTOM_ID: Todos-and-Tags
702 ** How can I cycle through the TODO keyword of an entry?
704 :CUSTOM_ID: cycle-TODO-keywords
707 =C-c C-t= or =S-<left/right>= is what you need.
709 ** How do I track state changes for tasks in Org?
711 :CUSTOM_ID: track-state-changes-for-tasks
714 Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
715 states and logging timestamps for task state changes.
717 ** Can I select the TODO keywords with a tag-like interface?
719 :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
722 Yes. Use =(setq org-use-fast-todo-selection t)=
724 If you want to set both your todos and your tags using a single
725 interface, then check out the variable
726 =org-fast-tag-selection-include-todo=.
728 See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
730 ** How can I quickly set the tag of an entry?
732 :CUSTOM_ID: quickly-set-tag-of-entry
735 Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
736 setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
737 keybinding for filing a note from the remember buffer.
739 You can set tags even more quickly by setting one of the character
740 shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
742 To set tag shortcuts for all org buffers, put something like the
743 following in your =.emacs= file (or create the same settings by
744 typing =M-x customize-variable RET org-tag-alist=):
746 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
748 To set tag shortcuts for a single buffer, put something like the
749 following at the top of your org file:
751 : #+TAGS: computer(c) office(o) home(h)
753 ** How can I change the colors of TODO keywords?
755 You can use the variable org-todo-keyword-faces. Here are some sample
758 #+begin_src emacs-lisp
759 (setq org-todo-keyword-faces
761 ("TODO" . (:foreground "firebrick2" :weight bold))
762 ("WAITING" . (:foreground "olivedrab" :weight bold))
763 ("LATER" . (:foreground "sienna" :weight bold))
764 ("PROJECT" . (:foreground "steelblue" :weight bold))
765 ("DONE" . (:foreground "forestgreen" :weight bold))
766 ("MAYBE" . (:foreground "dimgrey" :weight bold))
767 ("CANCELED" . shadow)
771 If you want to change the color of all active todos or all inactive
774 : M-x customize-face RET org-todo
775 : M-x customize-face RET org-done
777 You can also set values for each of these in your =.emacs= file:
779 : (set-face-foreground 'org-todo "firebrick2")
780 : (set-face-foreground 'org-done "forestgreen")
784 :CUSTOM_ID: Hyperlinks
786 ** Why do I have to confirm the execution of each shell/elisp link?
788 :CUSTOM_ID: confirm-shell/elisp-link
791 The confirmation is there to protect you from unwantingly execute
792 potentially dangerous commands. For example, imagine a link
794 : [[shell:rm -rf ~/*][Google Search]]
796 In an Org-mode buffer, this command would look like /Google Search/,
797 but really it would remove your home directory. If you wish, you can
798 make it easier to respond to the query by setting
800 : (setq org-confirm-shell-link-function 'y-or-n-p
801 : org-confirm-elisp-link-function 'y-or-n-p).
803 Then a single keypress will be enough to confirm those links. It is
804 also possible to turn off this check entirely, but I strongly
805 recommend against this. Be warned.
807 ** Can I use RET or TAB to follow a link?
809 :CUSTOM_ID: RET-or-TAB-to-follow-link
814 : (setq org-return-follows-link t)
815 : (setq org-tab-follows-link t)
817 ** Can I keep mouse-1 clicks from following a link?
819 :CUSTOM_ID: mouse-1-following-link
822 Activating links with =mouse-1= is a new feature in Emacs 22, to make
823 link behavior similar to other applications like web browsers. If
824 you hold the mouse button down a bit longer, the cursor will be set
825 without following the link. If you cannot get used to this behavior,
826 you can (as in Emacs 21) use =mouse-2= to follow links and turn off
827 link activation for =mouse-1= with
829 : (setq org-mouse-1-follows-link nil)
831 ** How can I get completion of file names when creating a link?
833 :CUSTOM_ID: completion-of-file-links
836 You can use org-insert-link with a prefix argument:
840 You will be greeted with prompt in the minibuffer that allows for file
841 completion using your preferred Emacs method for finding files.
845 :CUSTOM_ID: Plain-Lists
847 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
849 :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
852 : (setq org-blank-before-new-entry
853 : '((heading . t) (plain-list-item . nil))
855 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
857 ** How can I convert itemized lists to enumerated lists?
859 :CUSTOM_ID: convert-itemized-to-enumerated-lists
862 You can use =C-c -= or =S-<left>/<right>= to cycle through the various
863 bullet headlines available for lists: =-, +, *, 1., 1)=.
865 See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
867 ** How can I convert plain lists to headlines and vice versa?
869 :CUSTOM_ID: convert-plain-lists-to-headlines
872 To convert a plain list item or line to a headline, type =C-c *= on
873 the headline. This will make the line a subheading of the current
876 To convert a headline to a plain list item, type =C-c -= while the
877 cursor is on the headline.
879 To convert a headline to an unadorned line of text, type =C-c *= on
882 You can use query replace to accomplish the same things, as Bernt
883 Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
885 ** Is there a good way to create a description list?
887 :CUSTOM_ID: description-lists
890 Yes, these are now built-in:
893 - item1 :: Description of this item 1
894 - item2 :: Description of this item 2
895 - item1 :: Description of this item 3
896 also in multiple lines
903 ** Can I plot data from a table?
905 :CUSTOM_ID: plotting-table-data
908 Yes, you can, using org-plot.el written by James TD Smith and now
909 bundled with Org. See [[http://orgmode.org/manual/Org-Plot.html#Org-Plot][the manual section about this]].
911 See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
913 ** How can I fill a table column with incremental numbers?
915 :CUSTOM_ID: fill-table-column-with-incremental-numbers
918 Here is how: Use a field formula to set the first value in the column:
930 Then define a column formula in the second field:
942 After recomputing the table, the column will be filled with
952 ,#+TBLFM: $1=@-1 + 1::@2$1=1
955 Note that you could use arbitrary starting values and column formulas.
957 ** Why does my table column get filled with #ERROR?
959 :CUSTOM_ID: table-column-filled-with-ERROR
962 Org-mode tried to compute the column from other fields using a
963 formula stored in the =#+TBLFM:= line just below the table, and
964 the evaluation of the formula fails. Fix the fields used in the
965 formula, or fix the formula, or remove it!
967 ** How can I stop the table editor from creating new lines?
969 :CUSTOM_ID: table-editor-creates-new-lines
972 When I am in the last column of a table and just above a horizontal
973 line in the table, pressing TAB creates a new table line before the
974 horizontal line. To move to the line below the
975 horizontal line instead, do this:
977 Press =down= (to get on the separator line) and then =TAB=.
978 Or configure the variable
980 : (setq org-table-tab-jumps-over-hlines t)
982 ** How can I get table fields starting with "="?
984 :CUSTOM_ID: table-fields-starting-with-=
989 : (setq org-table-formula-evaluate-inline nil)
991 this will no longer happen. You can still use formulas using the
992 commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
994 ** How can I change the indentation of an entire table without fixing every line by hand?
996 :CUSTOM_ID: change-indentation-entire-table
999 The indentation of a table is set by the first line. So just fix the
1000 indentation of the first line and realign with =TAB=.
1002 ** In my huge table the realigning after each TAB takes too long. What can I do?
1004 :CUSTOM_ID: table-realigning-after-TAB-takes-long
1007 Either split the table into several by inserting an empty line every
1008 100 lines or so. Or turn off the automatic re-align with
1010 : (setq org-table-automatic-realign nil)
1012 After this the only way to realign a table is to press =C-c C-c=. It
1013 will no longer happen automatically, removing the corresponding delays
1016 ** Recalculation of my table takes too long. What can I do?
1018 :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1021 Nothing, really. The spreadsheet in org is mostly done to make
1022 calculations possible, not so much to make them fast. Since Org-mode
1023 is firmly committed to the ASCII format, nothing is stopping you from
1024 editing the table by hand. Therefore, there is no internal
1025 representation of the data. Each time Org-mode starts a computation,
1026 it must scan the table for special lines, find the fields etc. This
1027 is slow. Furthermore, Calc is slow compared to hardware
1028 computations. To make this work with normal editing, recalculation
1029 is not happening automatically, or only for the current line, so that
1030 the long wait for a full table iteration only happens when you ask
1033 So for really complex tables, moving to a "real" spreadsheet may
1034 still be the best option.
1036 That said, there are some ways to optimize things in Org-mode, and I
1037 have been thinking about moving a bit further down this line.
1038 However, for my applications this has so far not been an issue at
1039 all. If you have a good case, you could try to convince me.
1041 ** =S-RET= in a table keeps increasing the copied numbers. How can I stop this?
1043 :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1046 Well, it is /supposed/ to be a feature, to make it easy to create a
1047 column with increasing numbers. If this gets into your way, turn it
1050 : (setq org-org-table-copy-increment nil)
1054 :CUSTOM_ID: Remember
1056 ** Can I use the remember buffer to clock a customer phone call?
1058 :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
1061 Yes, you can. Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
1062 and check out (in the same thread) what Nick Docos had to fix to
1063 make Bernt's set-up work for him.
1064 ** Can I automatically start the clock when opening a remember template?
1066 :CUSTOM_ID: start-clock-when-opening-remember-template
1069 Yes, this is possible. Use the following code and make sure that
1070 after executing it, `my-start-clock-if-needed' is in
1071 `remember-mode-hook' /after/ `org-remember-apply-template'.
1073 : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
1074 : (defun my-start-clock-if-needed ()
1076 : (goto-char (point-min))
1077 : (when (re-search-forward " *CLOCK-IN *" nil t)
1078 : (replace-match "")
1081 Then, when a template contains the key string CLOCK-IN, the clock
1082 will be started. Starting with Org-mode version 5.20, the clock will
1083 automatically be stopped when storing the remember buffer.
1087 :CUSTOM_ID: Searches
1089 ** Isearch does not find string hidden in links. What can I do?
1091 :CUSTOM_ID: isearch-in-links
1094 M-x =visible-mode= will display the full link, making them searchable.
1096 ** How can I reduce the amount of context shown in sparse trees?
1098 :CUSTOM_ID: context-in-sparse-trees
1101 Take a look at the following variables:
1103 - =org-show-hierarchy-above=
1104 - =org-show-following-headline=
1105 - =org-show-siblings=
1106 - =org-show-entry-blow=
1108 which give command-dependent control over how much context is shown
1109 by a particular operation.
1111 ** How can I combine the results of two calls to =org-occur=?
1113 :CUSTOM_ID: two-calls-to-org-occur
1116 You can construct a regular expression that matches all targets you
1117 want. Alternatively, use a =C-u= prefix with the second and any
1118 further calls to =org-occur= to keep the current visibility and
1119 highlighting in addition to the new ones.
1125 ** How can I change the advanced warning time for deadlines?
1126 ##<<warning-period-for-deadlines>>
1128 Deadline warnings appear in the daily agenda view a specified number
1129 of days before the deadline is due. The default setting is 14 days.
1130 You can change this with the variable =org-deadline-warning-days=.
1131 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
1135 : (setq org-deadline-warning-days 30)
1137 would cause warnings for each deadline to appear 30 days in advance.
1139 Naturally, you might not want warnings for all of your deadlines to
1140 appear so far in advance. Thus, you can change the lead time for
1141 individual items as follows:
1143 : * TODO Get a gift for the party
1144 : DEADLINE: <2009-01-16 Fri -2d>
1146 The "-2d" above changes the lead time for this deadline warning to two
1147 days in advance. You can also use "w" for weeks and "m" for months.
1148 ** How can I postpone a task until a certain date?
1150 :CUSTOM_ID: deferring-tasks
1153 The easiest way to postpone a task is to schedule it in the future.
1154 For instance, typing =C-c C-s +2w= on a headline will push a task two
1155 weeks into the future, so that it won't show up on the daily agenda
1156 until two weeks from now.
1158 If you'd like to prevent the task from showing up on your global todo
1159 list, you have a couple of options.
1161 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
1162 This will exclude any scheduled items from your global list of
1163 active todos (=C-c a t=). (The variable
1164 =org-agenda-todo-ignore-with-date= will exclude both scheduled and
1165 deadline items from your todo list).
1166 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
1167 item will still appear on your agenda two weeks from today, but it
1168 won't show up on your todo lists.
1169 ** Can I send myself an email containing tasks or other agenda info?
1171 :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
1174 Yes. See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
1176 ** How can I limit the agenda view to my "work" tasks?
1178 :CUSTOM_ID: limit-agenda-with-tag-filtering
1181 It is often convenient to group org files into separate categories,
1182 such as "home" and "work" (or "personal" and "professional"). One
1183 of the main reasons for such classification is to create agenda
1184 views that are limited by type of work or area of responsibility.
1185 For instance, while at work, one may want to see only professional
1186 tasks; while away from work, one may want to see only personal
1189 One way to categorize files and tasks is to use a "#+FILETAGS"
1190 declaration at the top of each file, such as:
1194 As long as org-use-tag-inheritance is turned on, the filetags will
1195 be inherited by all tasks in the file. A file can have multiple
1196 filetags. And, of course, tags can be added to individual headings.
1198 Tasks can be quickly filtered by tag from within the agenda by
1199 typing "/" and the name of the tag. The full key sequence to filter
1200 for work items in an agenda view would be:
1202 : C-c a a / work [or a tag shortcut]
1204 ** How can I limit the agenda view to a particular category?
1206 :CUSTOM_ID: limit-agenda-with-category-match
1209 Another way to filter agenda views by type of work is to use a
1210 "#+CATEGORY" declaration at the top of each file, such as:
1214 Categories can also be added to individual headings within a file:
1221 All todos belonging to the category "work" can be found a with a
1222 simple tags-todo search:
1226 At the prompt, type:
1230 The same results can be achieved with custom agenda commands, such as:
1232 #+BEGIN_SRC emacs-lisp
1233 (setq org-agenda-custom-commands
1234 '(("h" tags-todo "CATEGORY=\"home\"")
1235 ("w" tags-todo "CATEGORY=\"work\"")
1236 ;; other custom agenda commands here
1240 ** How can include all org files in a directory in my agenda?
1242 :CUSTOM_ID: set-agenda-files-using-wildcards
1245 You can use the file-expand-wildcards function to all files ending in
1246 =org= in a directory to your agenda files list:
1248 : (setq org-agenda-files (file-expand-wildcards "~/org/*.org"))
1250 ** Why aren't items disappearing from my agenda once they are marked done?
1252 :CUSTOM_ID: removing-done-items-from-agenda
1255 If items remain on your daily/weekly agenda after they are marked
1256 done, check the configuration of the following variables:
1258 : org-agenda-skip-scheduled-if-done
1259 : org-agenda-skip-deadline-if-done
1260 : org-agenda-skip-timestamp-if-done
1264 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
1266 If this variable is turned off (=nil=), then scheduled items will
1267 remain on the agenda even after they are marked done.
1269 If the variable is turned on (=t=), then scheduled items will
1270 disappear from the agenda after they are marked done.
1272 If these settings seem not to behave the way you expect, then make
1273 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
1274 difference between SCHEDULED, DEADLINE, and timestamps]].
1276 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
1278 :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
1281 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
1282 the day they are scheduled and on every day thereafter until they
1283 are done. Schedule a task if you want to be reminded to do
1284 something beginning on a certain day and until it is done.
1286 : ** TODO Scheduled item
1287 : SCHEDULED: <2009-03-01 Sun>
1289 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
1290 agenda in advance of the when they are due and remain on your
1291 agenda until they are done. Add a DEADLINE to an item if you want
1292 to make sure to complete it by a certain date. (The variable
1293 org-deadline-warning-days determines how far in advance items with
1294 deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
1297 : ** TODO Item with a deadline
1298 : DEADLINE: <2009-01-20 Tue>
1300 3. An active timestamp (set with =C-c .=) will appear on your agenda
1301 only on the day it is scheduled. Use a timestamp for appointments
1302 or any reminders you want to show up only on a particular day.
1304 : ** TODO Item with an active timestamp
1307 Note: items with inactive timestamps (set with C-c ! and marked by
1308 square brackets) will not show up in the agenda at all.
1310 ** Can I add files recursively to my list of agenda files?
1312 :CUSTOM_ID: set-agenda-files-recursively
1315 Yes, you can use the library "find-lisp."
1317 : (load-library "find-lisp")
1318 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
1320 This will add all files ending in =org= in the directory "~/org"
1321 and all of its subdirectories to your list of agenda files.
1323 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
1325 * Appointments/Diary
1327 :CUSTOM_ID: Appointments/Diary
1329 ** Is it possible to include entries from org-mode files into my emacs diary?
1331 :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
1334 Since the org-mode agenda is much more powerful and can contain the
1335 diary, you should think twice before deciding to do this. If you
1336 insist, however, integrating Org-mode information into the diary is
1337 possible. You need to turn on /fancy diary display/ by setting in
1340 : (add-hook 'diary-display-hook 'fancy-diary-display)
1342 Then include the following line into your ~/diary file, in
1343 order to get the entries from all files listed in the variable
1348 You may also select specific files with
1350 : &%%(org-diary) ~/path/to/some/org-file.org
1351 : &%%(org-diary) ~/path/to/another/org-file.org
1353 If you now launch the calendar and press @<tt>d@</tt> to display a
1354 diary, the headlines of entries containing a timestamp, date range,
1355 schedule, or deadline referring to the selected date will be listed.
1356 Just like Org-mode's agenda view, the diary for /today/ contains
1357 additional entries for overdue deadlines and scheduled items. See
1358 also the documentation of the =org-diary= function. Under XEmacs, it
1359 is not possible to jump back from the diary to the org, this works
1360 only in the agenda buffer.
1361 ** I want to add my Org scheduled/deadlined entries in my diary!
1363 :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
1366 Put this in your ~/.diary:
1368 : &%%(org-diary :scheduled :timestamp :deadline)
1370 ** How can I set up automatic reminders based on Org information?
1372 :CUSTOM_ID: automatic-reminders
1375 See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
1376 ** How can I make =appt= notice my Org appointments?
1378 :CUSTOM_ID: appt-notice-my-Org-appointments
1381 : M-x org-agenda-to-appt RET
1383 ** How can I shedule an weekly appointment that lasts only until a certain date?
1385 :CUSTOM_ID: diary-sexp-in-org-files
1388 Org-mode's active timestamps work very well for scheduling individual
1389 or recurring appointments, such as:
1391 : * 8:00am Dentist appointment <2009-01-16 Fri>
1395 : * Weekly meeting with boss
1396 : <2009-01-20 Tue 14:00 +1w>
1398 Sometimes, however, you need to set up more complicated recurring
1399 appointments. Org-mode has built-in support for many of [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the powerful
1400 sexp entries]] that work in [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Diary.html#Diary][Emacs diary]]. Let's say, for instance, that
1401 you teach a class that meets every Monday evening between February 16
1402 and April 20, 2009. The way to enter this an org-mode file is:
1404 : ** Class 7:00pm-9:00pm
1405 : <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
1407 The expression above designates all Mondays (1) that fall between
1408 February 16 and April 20.
1410 For more ideas on how to create such expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this page on the
1417 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
1419 :CUSTOM_ID: export-TODO-items-as-lists
1422 If you plan to use ASCII or HTML export, make sure things you want to
1423 be exported as item lists are level 4 at least, even if that does
1424 mean there is a level jump. For example:
1426 : * Todays top priorities
1427 : **** TODO write a letter to xyz
1428 : **** TODO Finish the paper
1429 : **** Pick up kids at the school
1431 Alternatively, if you need a specific value for the heading/item
1432 transition in a particular file, use the =#+OPTIONS= line to
1433 configure the H switch.
1435 : #+OPTIONS: H:2; ...
1437 ** Can I export only a single subtree?
1439 :CUSTOM_ID: export-single-subtree
1442 If you want to export a subtree, mark the subtree as region and then
1443 export. Marking can be done with =C-c @ C-x C-x=, for example.
1445 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
1447 :CUSTOM_ID: iCal-import-ics-files-old
1450 When using iCal under Apple MacOS X Tiger, you can create a new
1451 calendar /OrgMode/ (the default name for the calendar created by =C-c
1452 C-e c=, see the variables =org-icalendar-combined-name= and
1453 =org-combined-agenda-icalendar-file=). Then set Org-mode to
1454 overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
1455 You may even use AppleScript to make iCal re-read the calendar files
1456 each time a new version of /OrgMode.ics/ is produced. Here is the
1457 setup needed for this:
1459 : (setq org-combined-agenda-icalendar-file
1460 : "~/Library/Calendars/OrgMode.ics")
1461 : (add-hook 'org-after-save-iCalendar-file-hook
1464 : "osascript -e 'tell application \"iCal\" to reload calendars'")))
1466 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
1468 :CUSTOM_ID: iCal-import-ics-files-new
1471 For Mac OS X 10.4, you need to write the ics file to
1472 =/Library/WebServer/Documents/= and then subscribe iCalendar to
1473 =http: //localhost/orgmode.ics=
1475 ** How can I remove timestamps and todo keywords from my exported file?
1477 :CUSTOM_ID: export-options-remove-timestamps
1480 You can place an options line at the top of your org file:
1482 : #+OPTIONS: <:nil todo:nil
1484 There is a whole host of export options you can set with an in-buffer
1485 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
1488 ** How can I preserve faces when I export an agenda from the command line?
1490 :CUSTOM_ID: preserving-faces-during-batch-export
1493 Normally, when you export an org file or an agenda view from within
1494 emacs, htmlize will convert your face definitions to direct color css
1495 styles inlined into each =<span>= object, resulting in an HTML output
1496 that preserves the general look of your Org buffers and agenda views.
1498 Let's say you generate an export from the command line, such as the
1501 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
1505 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
1507 In such an instance, the exported HTML will contain only very basic
1508 color styles. The reason is that when Emacs is run in batch mode, it
1509 does not have a display and therefore only rudimentary face
1510 definitions. If you'd like to use more complex styles, you'll have to
1511 make sure that the export process only assigns classes instead of
1512 direct color values. This can be done by binding the variable
1513 =org-export-htmlize-output-style= to =css= for the duration of the
1514 export, for example with
1516 : emacs -batch -l ~/.emacs
1517 : -eval '(let ((org-export-htmlize-generate-css (quote css)))
1518 : (org-batch-agenda "e"))'
1520 Then you can use a style file to make these classes look any way you
1521 like. To generate face definitions for a CSS file based on any faces
1522 you are currently using in Emacs, you can use the following command:
1524 : M-x org-export-htmlize-generate-css RET
1526 This will generate a =<style>...</style>= section, the content of
1527 which you can add to your style file.
1530 * COMMENT HTML style specifications
1532 #+begin_src emacs-lisp
1533 (defun org-faq-make-target ()
1534 "Make hard target for current headline."
1536 (if (not (org-on-heading-p))
1537 (error "Not on a headline"))
1538 (let ((h (org-trim (org-get-heading 'no-tags))))
1539 (if (string-match "[ \t]*\\?\\'" h)
1540 (setq h (replace-match "" t t h)))
1541 (while (string-match "[ \t]+" h)
1542 (setq h (replace-match "-" t t h)))
1543 (org-entry-put nil "CUSTOM_ID" h)))
1548 # org-export-html-style: ""
1549 # org-export-html-style-extra: "<link rel=stylesheet href=\"/org.css\" type=\"text/css\" />"